十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
1_5.DDBAB
雨花台网站建设公司成都创新互联,雨花台网站设计制作,有大型网站制作公司丰富经验。已为雨花台上千家提供企业网站建设服务。企业网站搭建\成都外贸网站建设公司要多少钱,请找那个售后服务好的雨花台做网站的公司定做!
二.
1.第一次循环X为1,y为1,z为4;输出6;第二次循环X为6,y为1,z为4;输出11;第三次循环X为11,y为1,z为4;输出16;
2. 要区别于break,break是符合条件直接跳出循环,不再执行循环操作。continue是跳到下一循环,执行下步循环操作 1 4 7
答案给你做参考的,采不采纳无所谓
#includestdio.h
#define N 3
void convert(int array[3][3])
{
int i,j,t;
for(i=0;iN;i++)
for(j=i+1;jN;j++)
{
t=array[i][j];
array[i][j]=array[j][i];
array[j][i]=t;
}
}
void main()
{
int i,j,a[3][3];
for(i=0;iN;i++)
for(j=0;jN;j++)
scanf("%d",a[i][j]);
convert(a);
for(i=0;iN;i++)
{
for(j=0;jN;j++)
printf("%5d",a[i][j]);
printf("\n");
}
}
//#include "a href=";tn=44039180_cprfenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1YLPjFBrHIBnHubm1cvnWP-0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EPjRvP1c4njfkrjmzP1mYPHcd" target="_blank" class="baidu-highlight"stdafx.h/a"//a href=";tn=44039180_cprfenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1YLPjFBrHIBnHubm1cvnWP-0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EPjRvP1c4njfkrjmzP1mYPHcd" target="_blank" class="baidu-highlight"vc++6.0/a加上这一行.
#include "a href=";tn=44039180_cprfenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1YLPjFBrHIBnHubm1cvnWP-0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EPjRvP1c4njfkrjmzP1mYPHcd" target="_blank" class="baidu-highlight"stdio.h/a"
int main(void){
char name[5][15],course[3][30];
int i,j;
double score[5][6],tmp[2][6]={0};
printf("请输入5个学生的姓名:\n");
for(i=0;i5;scanf("%s",name[i++]));
printf("请输入3门课程名:\n");
scanf("%s%s%s",course[0],course[1],course[2]);
printf("分别输入5个学生3门复种的成绩:\n");
for(i=0;i5;i++){
printf("\t第%d个学生: ",i+1);
scanf("%lf%lf%lf",score[i][0],score[i][1],score[i][2]);
score[i][3]=score[i][0]+score[i][1]+score[i][2];
score[i][4]=score[i][3]/3;
for(score[i][5]=score[i][0],j=1;j3;j++)
if(score[i][5]score[i][j])
score[i][5]=score[i][j];
}
for(i=0;i5;i++)
for(j=0;j6;j++){
tmp[0][j]+=score[i][j];
if(tmp[1][j]score[i][j])
tmp[1][j]=score[i][j];
}
printf("-----------------------------------------------------------------\n");
printf("\t %s %s %s 总分 平均分 最高分\n",course[0],course[1],course[2]);
printf("-----------------------------------------------------------------\n");
for(i=0;i5;i++){
printf(" %s\t ",name[i]);
for(j=0;j6;printf("%-10.1f",score[i][j++]));
printf("\n");
}
printf("-----------------------------------------------------------------\n");
printf("平均分\t ");
for(i=0;i6;printf("%-10.1f",tmp[0][i++]/5));
printf("\n最高分\t ");
for(i=0;i6;printf("%-10.1f",tmp[1][i++]));
printf("\n-----------------------------------------------------------------\n");
return 0;
}