tony小白
幼苗
共回答了18个问题采纳率:100% 举报
#include
#include
#define NUM 20
int main()
{
int scores[NUM];
printf("Please enter English scores:n");
for ( int i = 0; i < NUM; i++)
{
printf("%d:",i+1);
scanf("%d",&scores[i]);
}
int total = 0;
int _90 = 0;
int _60 = 0;
for ( int i = 0; i < NUM; i++ )
{
total += scores[i];
if( scores[i] >= 90 )
_90++;
else if( scores[i] < 60 )
_60++;
}
printf("Average scores:%.2fn 90+=%dn 60-=%d",(float)total/NUM,_90,_60);
return 0;
}
1年前
6