What happens when you attempt to compile and run the following code?
#include
#include
using namespace std;
int main() {
int t[] = { 1, 1, 2, 2, 3, 3, 4, 4, 5, 5 };
string s[] = { "one", "one", "two", "two", "three","three", "four", "four", "five", "five"};
multimap
for (int i = 0; i < 10; i++) {
m.push_back(pair
}
for (multimap
cout << i?>first << " ";
}
return 0;
}
What happens when you attempt to compile and run the following code?
#include
using namespace std;
int main ()
{
float f1 = 10.0;
float f2 = 10.123;
cout<<noshowpoint< return 0; } Program outputs:
What happens when you attempt to compile and run the following code?
#include
#include
#include
using namespace std;
template
int calculate(T start, T end)
{
int s = 0;
while (start != end)
s+= *start; start++;return s;
}
int main ()
{
int t[] = {1, 2 ,3 ,4 ,5, 6 , 7, 8 , 9, 10};
vector
deque
cout<<calculate(t,t+10)<<" ";
cout<<calculate(v1.begin()+1,v1.end()?2)<<" ";
cout<<calculate(d1.rbegin()+1,d1.rend()?2)<<" ";
cout<<calculate(t[0],t[10])<<" ";
cout<<endl;
return 0;
}
What happens when you attempt to compile and run the following code?
#include
#include
#include
#include
using namespace std;
template
ostream & out;
Out(ostream & o): out(o){}
void operator() (const T & val ) { out< int main() { int t[]={3,2,4,1,5,6,10,8,7,9}; vector for_each(v1.begin(), v1.end(), bind1st(plus for_each(v1.rbegin(), v1.rend(), Out return 0; } Program outputs: