
当输入负数时,怎么清屏评委人数。#include <stdio.h>
#define MAX_ARRAY 10
#include<windows.h>
main()
{
int i,Judgesnumber,grade,topscore,lowestmark,tp,a[MAX_ARRAY];
tp=0;
do
{
system ("cls");
printf("评委人数:");
scanf("%d\n",&Judgesnumber);
}
while(Judgesnumber<0);
for(i=0;i<=Judgesnumber-1;i++)
{
scanf("%d",&grade);
a[i]=grade;
tp+=a[i];
}
topscore=a[0];
lowestmark=a[0];
for(i=0;i<=Judgesnumber-1;i++)
{
if(a[i]>= topscore)
topscore=a[i];
if(a[i]<=lowestmark)
lowestmark=a[i];
}
tp-=(topscore+lowestmark);
// Sleep(100);
printf("最高分:%d\n",topscore);
printf("最低分:%d\n",lowestmark);
printf("最后得分:%d\n",tp);
}