填空题

以下程序的输出结果是 。
#include<iostream.h>
void fun( )
static int a=0;
a+=2;
cout < < a < < " ";
void main( )
int cc;
for(cc=1;cc<4;cc++)
fun( ) ;
cout < < endl;

【参考答案】

2 4 6
<上一题 目录 下一题>
热门 试题

单项选择题
下列程序执行后,屏幕的输出是( )。 #include<iostream> using namespace std; void swap(int x,int y) int temp=x; x=y; y=temp; cout<< x= <<x<< ,y= <<y<<end1; int main() int x=3,y=2; swap(x,y); cout<< x= <<x<< ,y= <<y<<end1; return 0;
A) x=3,y=2
x=3,y=2
B) x=2,y=3
x=3,y=2
C) x=2,y=3
x=2,y=3
D) x=3,y=2
x=2,y=3
单项选择题
下列程序中,划线处正确的语句是( )。 #include<iostream.h> Class Base Public: Void fun()cout<< Base::fun <<endl; ; Class Derived:public Base void fun() ______ 显示调用基类的函数fun() Cout<< Derived::fun <<endl; ;
A.fun()
B.Base.fun()
C.Base::fun()
D.Base->fun();
相关试题
  • 下列程序中需要清理动态分配的数组,划线处...
  • 有如下程序: #include<iostream> usi...
  • 深度为5的满二叉树有______个叶子结点。
  • 假定用户没有给一个名为MyClass的类定义析...
  • 下列程序的输出结果是______。 #in...