Câu 32: CPP: C++ Certified Professional Programmer
What happens when you attempt to compile and run the following code?#include #include #include #include using namespace std;template struct Out {ostream & out;Out(ostream & o): out(o){}void operator() (const T & val ) { out<<val<<" "; }};bool Compare(char a, char b) { return tolower(a) < tolower(b);} int main() { char…
Nội dung câu hỏi
What happens when you attempt to compile and run the following code?#include #include #include #include using namespace std;template struct Out {ostream & out;Out(ostream & o): out(o){}void operator() (const T & val ) { out<<val<<" "; }};bool Compare(char a, char b) { return tolower(a) < tolower(b);} int main() { char s[]={"qwerty"}; char t1[]={"ert"}; char t2[]={"ERT"}; sort(s, s+6); cout<<includes(s,s+6, t1,t1+3, Compare)<<" "<<includes(s,s+6, t2,t2+3, Compare)<<endl; return 0;}Program outputs:
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. 0 0
- B. 0 1
- C. 1 0
- D. 1 1 — đá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.