#include <stdio.h>
void main(){
int grade[10]={1,2,3,4,5,6,7,8,9,10};
int total=0;
int i;
float avg;
for(i=0;i<10;i++){
total+=grade[i];
}
avg=((float)total/10);
printf("the student's average is %f\n",avg);
}
#include <stdio.h>
void main(){
int grade[10]={1,2,3,4,5,6,7,8,9,10};
int total=0;
int i;
float avg;
for(i=0;i<10;i++){
total+=grade[i];
}
avg=((float)total/10);
printf("the student's average is %f\n",avg);
}
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。