填空题
以下程序的执行结果是______。
#include<iostream.h>
class Sample
int n;
public:
Sample()
Sample(int m)n+m;)
int&operator--(int)
n--
return n;
void disp () cout<<"n= "<<n<<end1;
void main ()
Sample s (10);
(s--) ++;
s.disp();
【参考答案】
程序的执行结果为:n=10
点击查看答案
<上一题
目录
下一题>
热门
试题
单项选择题
若有以下程序: #inclcude<iostream.h> void main() int i; int a[3][3]=’1’,’2’,’3’,’4’,’5’,’6’,’7’,’8’,’9’); for(i=0;i<3;i++) cout<<a[i][i]<< ; cout<<endl; 执行后的输出结果是( )
A.50 53 56
B.49 52 55
C.25 8
D.1 4 7
点击查看答案
单项选择题
有以下程序: #include<iostream.h> void main() int x=5,y=2; cout<<!(y==x 2)<< , ; cout<<y!=x%3)<< , ; cout<<(x>0&&y<0)<< , ; cout<<(x!=y‖x>=y)<<endl: 程序执行后的输出结果是( )
A.0,0,0,1
B.1,1,1 1
C.0,0, 1,1
D.1,1,0,0
点击查看答案
相关试题
耦会和内聚是评价模块独立性的两个主要标准...
已知double var;是文件F1.CPP中的一个...
空字符串的长度是_____。
实现比较两个字符串大小的函数是_____。
数据库管理系统常见的数据模型有层次模型、...