单项选择题
以下程序的执行结果是( )。
#include<iostream.h>
int fun(int b[],int n)
int i,r=1;
for(i=0;i<n;i++)
r=r*b[i];
void main()
int x,a[]=1,2,3,4,5,6,7,8;
x=fun(a,3);
cout<<x<<endl;
A.5
B.6
C.7
D.8
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
以下程序的输出的结果是( )。 #include<iostream.h> int x=3: void main() void fun(); int i; for(i=1;i<x;i++) fun(); void fun() static int x=1; x*=x+1; cout<<x<< ;
A.3,3
B.2,2
C.2,6
D.2,5
点击查看答案&解析
单项选择题
下面程序的运行结果是( )。 #include<iostream> using namespace std; class TestClass static int n; public: TestClass () n++; static int test() for(int i=0;i<4;i++) n++; return n; ; int TestClass::n=0; int main() cout<<TestClass::test()<< ; TestClass c1,c2; cout<<TestClass::test()<<endl; return ();
A.4,10
B.4,6
C.0,6
D.0,4
点击查看答案&解析
相关试题
执行语句序列: int x=10,&r=x; ...
对基类数据成员的初始化必须派生类的构造函...
在下面的程序的横线处填上适当的语句,使该...
在下面函数的横线处填上适当的内容,使该函...
非成员函数只有在声明为类的______时...