题目内容

有如下程序: #include<iostream> using namespace std; class TlestClass { int n; public: TestClass(int k):n(k){} int get(){return n;} int get()const{return n+1;} }; int main() { TestClass p(5); const TestClass q(6); cout<<p.get()<<q.get(); return 0; } 执行后的输出结果是______。

A. 55
B. 57
C. 75
D. 77

查看答案
更多问题

设程序如下: #include<iostream> using namespace std; int main() { int **p,*q,r=10; q=&r; p=&q; cout<<**p+1<<endl; return 0; } 以上程序的输出结果是______。

A. P的地址
B. r的地址
C. 11
D. 运行错误

有如下程序: #include<iostream> using namespace std; class Base{ protected: Base(){cout<<"Base";} Base(char c){cout<<c;} }; class Derived:public Base{ public: Derived(char c){cout<<c;} }; int main(){ Derived d("Derived"); return 0; } 执行这个程序屏幕上将显示输出______。

A. Derived
B. DerivedBase
C. BaseDerived
DerivedDerived

有如下程序: #include<iostream> using namespace std; int main() { cout.fill("*"); cout.width(6); cout.fill("#"); cout<<888<<endl; return 0; } 的执行结果是______。

A. ###888
B. 888###
C. ***888
D. 888***

下面的符号中可以用作C++标识符的是______。

A. 3test
B. fcc~other
C. else
D. radius

答案查题题库