Câu 2: CPP: C++ Certified Professional Programmer
What happens when you attempt to compile and run the following code?#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);multiset s1(v.begin(),v.end());s1.insert(v.begin(),v.end());pair ::iterator,multiset ::iterator> range; range = s1.equal_range(6); wh…
Nội dung câu hỏi
What happens when you attempt to compile and run the following code?#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);multiset s1(v.begin(),v.end());s1.insert(v.begin(),v.end());pair ::iterator,multiset ::iterator> range; range = s1.equal_range(6); while (range.first != range.second) { cout<<*range.first<<" "; range.first++;}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: 6 6 — đáp án hiện tại
- B. program outputs: 5 7
- C. program outputs: 5 5 6 6 7 7
- D. program outputs: 5 5 7 7
- E. program outputs: 1 1 6 6 5 5
Cộng đồng
0 bình luận công khai. Tên thành viên được ẩn một phần.