Câu 29: CPP: C++ Certified Professional Programmer
What happens when you attempt to compile and run the following code?#include #include #include #include using namespace std;template struct Out {ostream & out;Out(ostream & o): out(o){}void operator() (const T & val ) { out v1(t, t+10);for_each(v1.begin(), v1.end(), bind2nd(plus (), 1)); for_each(v1.rbegin(), v1.rend(…
Nội dung câu hỏi
What happens when you attempt to compile and run the following code?#include #include #include #include using namespace std;template struct Out {ostream & out;Out(ostream & o): out(o){}void operator() (const T & val ) { out v1(t, t+10);for_each(v1.begin(), v1.end(), bind2nd(plus (), 1)); for_each(v1.rbegin(), v1.rend(), Out (cout));cout<<endl; return 0;}Program outputs:
Các lựa chọn
Đáp án được giữ gọn theo nhãn A, B, C, D trong phần bình chọn tương tác.
- A. 3 2 4 1 5 6 10 8 7 9
- B. 4 3 5 2 6 7 11 9 8 10
- C. 9 7 8 10 6 5 1 4 2 3 — đáp án hiện tại
- D. 10 8 9 11 7 6 2 5 3 4
- E. compilation error
Cộng đồng
0 bình luận công khai. Tên thành viên được ẩn một phần.