填空题

以下程序的输出结果是 。
#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
<上一题 目录 下一题>
热门 试题

填空题
下列程序在构造函数和析构函数中申请和释放类的数据成员int * a,申请时使用形参b初始化a,请填空。 class A public: A(int b) ; ~A( ) ; private: int * a; ; A: :A(int b) 11 ; A: :~A( ) 12 ;
填空题
以下程序的输出结果是 。 #include<iostream.h> unsigned fun(unsigned num) unsigned k=1; dok * =num%10;num =10;while(num) ; return k; void main( ) unsigned n=26; cout < < fun(n) < < endl;
相关试题
  • 将x+y * z中的“+”用成员函数重载,...
  • C++语言程序的注释可以出现在程序中的任...
  • 用以下语句调用库函数malloc,使字符指针st...
  • C++语言中的多态性是在编译时通过 13...
  • 在C++语言的面向对象程序设计框架中, ...