下列程序的运行结果是 。 #include <iostream> using namespace std; float f (float sum, float x[ ], int n) { for(int i=0; i <n 8 ; i++) sum+="x[i];" return sum="0," n; } void main() { float x[]="{" 2, 4, 6, }, y; y="f(sum," x, 4); “sum="”<<sum<<endl;" “y="”<<y<<endl;">
第1题
A.5,2
B.7,11
C.11,23
D.9,23
第2题
#include<stdio.h>
main()
{ static char a[]="Languagef",b[]="programe";
Char*p1,*p2;int k;
p1=a;p2=b;
for(k=0;k<=8;k++)
if(*(p1+k)==*(p2+k))printf("%c",*(p1+k));
}
A.gae
B.ang
C.program
D.有语法错
第3题
#include<stdio.h>
main()
{stmct date
{int year,month,day;
}today;
primf("%d\n",sizeof(struct date));
}
A.8
B.6
C.10
D.12
第4题
A.gae
B.ang
C.program
D.有语法错
第5题
A.gae
B.ang
C.program
D.有语法错
第6题
#include<stdio.h>
#include<string.h>
main()
{ char*s1="abDuj";
char*s2="ABdUG";
int t;
t=strcmp(s1,s2) ;
printf("%d",t);
}
A.正数
B.负数
C.零
D.不确定的值
第7题
#include
class A
{
int a;
public:
A(){a=0;}
A(int as)
{
a=as;
cout<
}
};
void main()
{
Ax,y(2),z(3);
cout<
}
A.1
B.2
C.3
D.4
第8题
#include<iostream.h>
class A
{
int a;
public:
A( ) {a=0;}
A(int aa)
{
a=aa;
cout < < a++;
}
};
void main( )
A x,y(2) ,z(3) ;
cout < < endl;
}
A.00
B.23
C.34
D.25
第9题
A.0
B.23
C.34
D.25
第10题
A.5 0 6 4
B.0 0 6 4
C.5 0 6 2
D.0 0 6 2
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!