Câu 70: 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, 0, 1, 2, 3, 4, 0 };vector v(t, t+10);multimap m;for(vector ::iterator i=v.begin(); i!=v.end(); i++) { stringstream s; s (*i,s.str()));}for(multimap ::it…
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, 0, 1, 2, 3, 4, 0 };vector v(t, t+10);multimap m;for(vector ::iterator i=v.begin(); i!=v.end(); i++) { stringstream s; s (*i,s.str()));}for(multimap ::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 0 1 2 3 4 0
- B. program outputs: 00 11 22 33 44
- C. program outputs: 0 0 1 1 2 2 3 3 4 4
- D. program outputs: 0 0 0 1 1 1 2 2 2 3 3 3 4 4 4
- 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.