设有20人。
#include "stdio.h"
#define N 20
int main(int argv,char *argc[]){
int a[N],i;
printf("Please enter the %d students scores...\n",N);
for(i=0;i<N;i++){
while(scanf("%d",a+i)!=1 || a[i]<0 || a[i]>100)
printf("Input error, redo: ");
a[i]>=60 ? a[i]+=10 : a[i]=60;
}
printf("The revised points are as follows:\n");
for(i=0;i<N;printf("%4d",a[i++]));
printf("\n");
return 0;
}
运行样例:
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/29381f30e924b89979200dd765061d950b7bf6c5?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)