问答题
以下程序的输出结果是
#include<iostream.h>
void reverse(int a [ ] ,int n)
int i,t;
for(i=0;i<n/2;i++)
t=a[i];a[i]=a[n-1-i];a[n-1-i]=t;
void main( )
int b[10]=1,2,3,4,5,6,7,8,9,10;int i,s=0;
reverse(b,8);
for(i=6;i<10;i++)s+=b[i];
cout << S;
【参考答案】
A
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
单项选择题
下列程序中画线处应填入的语句是 class Base public: void fun( )cout<< Base of fun <<end1; ; class Derived:public Base void fun( ) ______ 显示基类的成员函数fun cout<< Derived of fun <<end1; ;
A.fun( );
B.Base.fun( );
C.Base: :fun( );
D.Base->fun( );
点击查看答案&解析
单项选择题
下面程序的输出结果是 #include<iostream.h> #include<string.h> void main( ) char p1[10],p2[10] strcpy(p1, abc ); strcpy(p2, ABC ); char str[50]= xyz ; strcpy(str+2,strcat(p1,p2)); cout<<str;
A.xyzabcABC
B.zabcABC
C.xyabcABC
D.yzabcABC
点击查看答案&解析
相关试题
已知程序的结果为1 2 3,请填空。 #...
下列程序段的输出结果是 【15】 。 co...
如果类B继承了类A,则称类A为类B的基类,类...
如果要把返回值为void的函数A声明为类B的友...
将x+y中的+运算符用友元函数重载应写为 ...