Câu 48: CPP: C++ Certified Professional Programmer
What happens when you attempt to compile and run the following code?#include #include #include #include #include using namespace std;int main(){int t[] ={ 3, 4, 2, 1, 6, 5, 7, 9, 8, 0 };vector v(t, t+10);map m;for(vector ::iterator i=v.begin(); i!=v.end(); i++) { stringstream s; s (*i,s.str()));}for(map ::iterator i=m…
Nội dung câu hỏi
What happens when you attempt to compile and run the following code?#include #include #include #include #include using namespace std;int main(){int t[] ={ 3, 4, 2, 1, 6, 5, 7, 9, 8, 0 };vector v(t, t+10);map m;for(vector ::iterator i=v.begin(); i!=v.end(); i++) { stringstream s; s (*i,s.str()));}for(map ::iterator i=m.begin();i!= m.end(); i++) { cout<<*i<<" ";}return 0;}
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. program outputs: 3 4 2 1 6 5 7 9 8 0
- B. program outputs: 00 11 22 33 44 55 66 77 88 99
- C. program outputs: 0 1 2 3 4 5 6 7 8 9
- D. program outputs: 0 00 1 11 2 22 3 33 4 44 5 55 6 66 7 77 8 88 9 99
- E. compilation error — đáp án hiện tại
Cộng đồng
0 bình luận công khai. Tên thành viên được ẩn một phần.