A.16
B.20
C.11
D.15
第1题
A、16
B、20
C、11
D、15
第3题
有以下程序
#include<stdio.h>
#define N 4
void fun(int a[][N],int b[])
{ int i;
for(i=0;i<N;i++)b[i]=a[i][i]-a[i][N-1-i];
}
main()
{ int x[N][N]:{{1,2,3,4},{5,6,7,8},{9,10,11,12},{13,14,15,16}},y[N],i;
fun(x,y);
for(i=0;i<N;i++) prinff("%d,",y[i]);printf("\n");
}
程序运行后的输出结果是A.-12,-3,0,0,
B.-3,-1,1,3,
C.0,1,2,3,
D.-3,-3,-3,-3,
【我提交的答案】: A |
【参考答案与解析】: 正确答案:B |
解析:从程序中看出,执行函数fun时,当i从0到3时,a[i][i]分别为1、6、11、16,a[i][N-1-i]分别为4、7、10、13,y[i]的值分别为两个数组对应值相减,所以答案为B)。
完全不懂
第4题
1)#include< iostream >
2)#include< cmath >
3)using namespace std;
4)double max(double x,doubley)
5){
6)if(x>y)
7)return x;
8)else
9)return y;
10)}
11)int main()
12){
13)doublea,b,c;
14)cout<<" input two numbers:"; 15)cin >>a >>b;
16)c=max(a,b);
17)cout<<" the squart of max imum="<< sqrt( c ); 18)}
执行完第14行后,命令提示符窗口中输出的结果是:()
第5题
1)#include< iostream >
2)# include< math.h >
3)using namespace std;
4)double max(double x,doubley);
5)void main()
6){
7)double?? a,b,c;
8)cout<< " input two numbers:"; 9)cin>>a>>b;
10)c=max(a,b);
11)cout<< " the squart of max imum="<< sqrt(c); 12)} 13)double max(doublex,doubley) 14){ 15)if(x>y)
16)returnx;
17)else
18)returny;
19)}
执行完第7行后,a的值是:()
A. 0
B. 1
C. 变量不存在
D. 随机值
第7题
B、0
C、5
D、2
第9题
A、x=0, y=1, z=1
B、x=0, y=0, z=1
C、x=0, y=2, z=2
D、x=0, y=2, z=1
第10题
A、y=20
B、y=50
C、不确定
D、代码错误,不能输出
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!