发布时间 : 星期日 文章2010年6月C++统考试卷 - A - new更新完毕开始阅读
9. 整型数据和字符型数据的类型不同,它们之间不能进行运算。 【 】 10. c++源程序的扩展名为cpp。 【 】
???? 11. 所谓私有成员是指只有类中所提供的成员函数才能直接访问它们,任何类以外
的函数对它们的访问都是非法的。 【 】
12. C++中使用了新的注释符(//),C语言中注释符(/*?*/)不能在C++中使用。
????? ※?※?※?? 线 ? ? ? ? ? ? 号?学? ? ? ? ? 订 ? ?名?姓? ? ? ? ? ? ? ? ? 级班装 ?※?※?※??????????【 】
本题
得分 四、写出下面各程序的运行结果(阅读程序,分析程序的运行结
果。每题5分,共20分)
1. #include
void main() { int i=1; while(i)
{ i++;
if(i= =10) break;
if(i%3!=1) cout<
运行结果: 2. #include
long int t,s=0; for(m=1;m<=n;m++) {
for(t=1,k=1;k<=m;k++) t*=m; s+=t; }
cout<<\}
运行结果: 3. #include”iostream.h” int func(int a)
【第 5 页 共 9 页】
{ static int c=1; c*=a; return c; }
void main( ) { int b=1,i; for(i=2;i<4;i++) b=b+func(i); cout<
运行结果: 4. #include
class A { private:
int a,b; public :
A( ) { a=b=0; cout < { a=aa; b=bb;