纠错
全专业资料、题库、学位、网课
最高直省2344元
上千+科次精品网课
买网课即送全真模考题库
五千+科次教材资料
电子资料满三件9折
五千+科次在线题库
全真呈现历年考试试题
1、[填空题]执行下面程序输出结果为( )。
#include
void main() {
int a[3][3]={{3,8,6},{5,9,2},{8,5,12}};
int i,j,s=0;
for(i=0;i<3;i++)
for(j=0;j<3;j++)
if(a[i][j]%3==0) s+=a[i][j];
printf("s=%d\n",s);
}
2、[填空题]执行了下面程序的输出结果为( )。
#include
void main() {
int i=0, s=0;
while(s<50) {i+=2; s+=i*i;}
printf("s=%d\n",s);
}
3、[填空题]执行了下面程序的输出结果是什么?()
#include
void main() {
int i,s=0;
for(i=1;i<10;i+=3) s+=i*(i+1);
printf("s=%d\n",s);
}
4、[填空题]执行如下程序的输出结果为( )。
#include
void main() {
int x=5,y=8;
if(x>=y) printf("%d %d\n",x,y);
else printf("%d %d\n",y,x);
}
5、[主观题]补充完整下面的函数定义,要求返回二维数组a[m][n]中所有元素的平均值。假定在计算过程中采用变量s存放累加值,采用i和j作为扫描数组的循环变量。
double Mean(double a[][N],int m,int n)
{
int i,j;
double s=0.0;
//在下面添上合适的for双重循环语句
return s/(m*n);
}
Copyright © 2010 - 2023 湖南求实创新教育科技有限公司 All Right Reserved.
温馨提示:如您需要的资料本网暂时没有,请于工作日08:00-18:00,点击这里,联系客服及时补充资料。