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

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

Which pieces of code inserted independently into places marked 1 and 2 will cause the program to compile and display: 0 1 2 3 4 5 6 7 8 9? Choose all that apply.#include #include using namespace std;class A { int a; public:A(int a){ this?>a=a;}//insert code here 1};//insert code here 2template void print(T start, T en…

Nội dung câu hỏi

Which pieces of code inserted independently into places marked 1 and 2 will cause the program to compile and display: 0 1 2 3 4 5 6 7 8 9? Choose all that apply.#include #include using namespace std;class A { int a; public:A(int a){ this?>a=a;}//insert code here 1};//insert code here 2template void print(T start, T end) {while (start != end) {std::cout l1(t1, t1 + 5);A t2[] ={ 3, 2, 6, 9, 0 };list l2(t2, t2 + 5);l1.sort();l2.sort();l1.merge(l2);print(l1.begin(), l1.end());print(l2.begin(), l2.end()); cout<<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. place 1: operator int() { return a; } — đáp án hiện tại
  2. B. place 1: operator int() { return a; }bool operator a< b.a;} — đáp án hiện tại
  3. C. place 1: bool operator a< b.a;}
  4. D. place 1: bool operator a< b.a;} friend ostream & operator <<(ostream & c, const A & a); place 2: ostream & operator <<(ostream & c, const A & a) { c<<a.a; return c;} — đáp án hiện tại
  5. E. place 1: bool operator a< b.a;} place 2: ostream & operator <<(ostream & c, const A & a) { c<<a.a; return c;}

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ề