yu13.cpp

来自「tc3 考试系统」· C++ 代码 · 共 28 行

CPP
28 行
字号
#include<stdio.h>
main()
{int score[35],i=1,j,sum=0,k;
 int English=0,Math=0,Computer=0;
 while(1)
 {printf("input %d 3scores",i);
  for (j=1;j<4;j++)
   {scanf("%d",&score[i][j]);
    if (score[i][j]<0)   goto pp;
    sum+=score[i][j];
    if (j==1)  English+=score[i][j]
    if (j==2)  Math +=score[i][j]
    if (j==3)  Computer+=score[i][j]
   }
  score[i][4]
  i++;
  sum=0;
 }
pp:putchar("\n");
   printf("English    Math     Computer     Average\n");
   for (k=1;k<i;k++)
     for (j=1;j<=4;j++)
     printf("%d",score[i][j]);
   putchar('\n');
 }
 printf("English=%d,Math=%d,Computer=%d",English,Math,Computer);
 }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?