#include
#include "stdio.h"
int main()
{
int score[30]={};
int num = 0;
for(int i=0;i<30;)
{
printf("输入第%d个学生成绩:",i+1);
if(scanf("%d",&score[i]))
{
if(score[i]<0)
break;
i++;
num++;
}
else
{
fflush(stdin);
printf(("输入错误。\n"));
}
}
int failnum = 0;
for(int i=0;i{
if(score[i]<60)
{
failnum++;
printf("第%d个学生不及格,成绩为:%d\n",i+1,score[i]);
}
}
printf("共%d个学生不及格\n",failnum);
for(int i =0;i{
for(int j=num-1;j>i;j--)
{
if(score[j]>score[j-1])
{
int temp = score[j-1];
score[j-1] = score[j];
score[j] = temp;
}
}
}
printf("成绩顺序:");
for(int i=0;i{
printf("%d\t",score[i]);
}
printf("\n");
printf("最高成绩:%d\n",score[0]);
printf("最低成绩:%d\n",score[num-1]);
return 0;
}