What happens when you attempt to compile and run the following code?
#include
#include
#include
using namespace std;
struct Compare {
bool operator ()(int a) {
if (a >5) return true;
return false;
}
};
int main () {
int t[] = {1,2,3,2,3,5,1,2,7,3,2,1,10, 4,4,5};
vector
int number = count(v.begin(), v.end(), Compare());
cout<< number<<endl;
return 0;
}
Program outputs:
What happens when you attempt to compile and run the following code?
#include
#include
#include
#include
using namespace std;
int main() {
int t[] = {1,2,3,2,3,5,1,2,7,3,2,1,10, 4,4,5};
vector
set
pair
cout<<*resultSet.first<<" "<<*resultSet.second<<endl;
return 0;
}
Program outputs:
What happens when you attempt to compile and run the following code?
#include
#include
#include
using namespace std;
int main(){
int t[] ={ 1, 1, 2, 2, 3, 3, 4, 4, 5, 5 };
list
set
if (s1.count(3) == 2) {
s1.erase(3);
}
for(set
cout<<*i<<" ";
}
return 0;
}