CertyRush
Đang tải...
C CertyRush
Câu hỏi free preview

Câu 67: CPP: C++ Certified Professional Programmer

What happens when you attempt to compile and run the following code?#include #include using namespace std;template void print(T start, T end) {while (start != end) {std::cout l1(t1, t1 + 5);int t2[] ={ 3, 2, 6, 9, 0 };list l2(t2, t2 + 5);l1.sort();list ::iterator it = l2.begin();it++; it++;l1.splice(l1.end(),l2, it, l…

Nội dung câu hỏi

What happens when you attempt to compile and run the following code?#include #include using namespace std;template void print(T start, T end) {while (start != end) {std::cout l1(t1, t1 + 5);int t2[] ={ 3, 2, 6, 9, 0 };list l2(t2, t2 + 5);l1.sort();list ::iterator it = l2.begin();it++; it++;l1.splice(l1.end(),l2, it, l2.end());print(l1.begin(), l1.end()); cout<<"Size:"<<l1.size()<<" "; print(l2.begin(), l2.end()); cout<<"Size:"<<l2.size()<<endl; 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.

  1. A. program outputs: 1 4 5 7 8 6 9 0 Size:8 3 2 Size:2 — đáp án hiện tại
  2. B. program outputs: 1 4 5 7 8 6 9 0 Size:8 3 2 6 9 0 Size:5
  3. C. compilation error
  4. D. program outputs: 0 1 4 5 6 7 8 9 Size:8 3 2 Size:2
  5. E. program outputs: 0 1 4 5 6 7 8 9 Size:8 3 2 6 9 0 Size:5

Cộng đồng

0 bình luận công khai. Tên thành viên được ẩn một phần.

Chưa có bình luận. Mở giao diện tương tác để bắt đầu thảo luận.

Câu hỏi liền kề