#include "stdio.h"
#define N 70
main()
{
int s[N],i,score=0,avg=0,max,min,flag1=0,flag2=0;
for(i=0;i<N;i++)
{
printf("input score:");
scanf("%d",&s[i]);
score +=s[i];
}
avg=score/N;
printf("the avg:%d\n",avg);
for(i=0;i<N;i++)
{
if(s[i]<avg)
printf("less avg:%d\n",s[i]);
else
continue;
}
max=s[0];min=s[0];
for(i=1;i<N;i++)
{
if(s[i]>max)
{
max=s[i];
flag2=i;
}
else
continue;
}
for(i=1;i<N;i++)
{
if(s[i]<min)
{
min=s[i];
flag1=i;
}
else
continue;
}
printf("the max is%d,\tflag is:
%d\n",max,flag2+1);
printf("the min is%d,\tflag is:
%d\n",min,flag1+1);
for(i=0;i<N;i++)
{
if(s[i]>=90)
printf("the score is : A\n");
else if(s[i]>=80&&s[i]<=89)
printf("the score is : B\n");
else if(s[i]>=70&&s[i]<=79)
printf("the score is : C\n");
else if(s[i]>=60&&s[i]<=69)
printf("the score is : D\n");
else
printf("the score is :F\n");
}
getch();
}
这样你自己看看吧.