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

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

What will happen when you attempt to compile and run the code below, assuming that you enter the following sequence: 1 2 3 end ?#include #include #include #include using namespace std;template struct Out {ostream & out;Out(ostream & o): out(o){}void operator() (const T & val ) {out l;for( ; !cin.bad() ; ){int i;cin>>i…

Nội dung câu hỏi

What will happen when you attempt to compile and run the code below, assuming that you enter the following sequence: 1 2 3 end ?#include #include #include #include using namespace std;template struct Out {ostream & out;Out(ostream & o): out(o){}void operator() (const T & val ) {out l;for( ; !cin.bad() ; ){int i;cin>>i;l.push_back(i);}for_each(l.begin(), l.end(), Out (cout));return 0;}Program will output:

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. 1 2 3
  2. B. 1 2 3 end
  3. C. 1
  4. D. compilation error
  5. E. program runs forever without output — đá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.

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ề