填空题
若有以下程序: #include <iostream> using namespace std; class Sample { private: const int n; public: Sample(int i) :n(i) {) void print() { cout<<"n="<<n<<end1; } }; int main() { sample a(10); a.print(); return 0; } 上述程序运行后的输出结果是
【14】
。
【参考答案】
n=10
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
若有如下程序段:#include <iostream>using namespace std;int main(){char *p= abcdefgh ,*r;long *q;q=(long *)p;q++;r=(char *)q;cout<<r<<end1;return 0;}该程序的输出结果是 【8】 。
点击查看答案&解析
填空题
以下程序的输出结果是 【9】 。#include <iostream>using namespace std;void fun(){static int a=0;a+=2;cout<<a;}int main(){int CC;for(CC=1;cc<4;CC++)fun();cout<<end1;return 0;}
点击查看答案&解析
相关试题
【13】 使一个函数可以定义成对许多不同...
有以下程序:#include <iostream>#inc...