void main()
{
int score1,score2,score,well,good,all,n;
double score_ave;
printf("請輸入全班人數:\n");
scanf("%d",&all);
printf("依次輸入成績:\n");
well=0;
good=0;
for(n=1;n<=all;n++)
{ scanf("%d,%d",&score1,&score2);
score=score1+score2;score_ave=(score1+score2)/2;
if(score_ave>=0&&score_ave<60)
{printf("不及格\n"); printf("%d,%f\n",score,score_ave);}
else if(score_ave>=60&&score_ave<85)
{good++; printf("通過\n"); printf("%d,%f\n",score,score_ave);}
else if(score_ave>=85&&score_ave<=100)
{well++; printf("優秀\n"); printf("%d,%f\n",score,score_ave);}
else
printf("錯誤\n");
}
printf("優秀人數:%d通過人數:%d\n",well,good);
}