1_5.DDBAB
雨花臺(tái)網(wǎng)站建設(shè)公司成都創(chuàng)新互聯(lián),雨花臺(tái)網(wǎng)站設(shè)計(jì)制作,有大型網(wǎng)站制作公司豐富經(jīng)驗(yàn)。已為雨花臺(tái)上千家提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\成都外貿(mào)網(wǎng)站建設(shè)公司要多少錢,請(qǐng)找那個(gè)售后服務(wù)好的雨花臺(tái)做網(wǎng)站的公司定做!
二.
1.第一次循環(huán)X為1,y為1,z為4;輸出6;第二次循環(huán)X為6,y為1,z為4;輸出11;第三次循環(huán)X為11,y為1,z為4;輸出16;
2. 要區(qū)別于break,break是符合條件直接跳出循環(huán),不再執(zhí)行循環(huán)操作。continue是跳到下一循環(huán),執(zhí)行下步循環(huán)操作 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"http://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("請(qǐng)輸入5個(gè)學(xué)生的姓名:\n");
for(i=0;i5;scanf("%s",name[i++]));
printf("請(qǐng)輸入3門課程名:\n");
scanf("%s%s%s",course[0],course[1],course[2]);
printf("分別輸入5個(gè)學(xué)生3門復(fù)種的成績(jī):\n");
for(i=0;i5;i++){
printf("\t第%d個(gè)學(xué)生: ",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;
}