#include <stdio.h>
#include <stdlib.h>
#include "windows.h"
int main(int argc, char *argv[])
{
int cj;
do{
system("cls");
printf("请输入成绩:");
scanf("%d",&cj);
if(cj>0 && cj<101)
{
if(cj>=90 && cj<=100)
printf("\n优秀\n");
else if(cj>=70 && cj<=89)
printf("\n良好\n");
else if(cj>=60 && cj<=69)
printf("\n及格\n");
else if(cj>=0 && cj<=59)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY | FOREGROUND_RED);
printf("\n不及格\n");
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN);
}
}
else
{
printf("\nerror\n");
}
printf("\n如果要继续请按y\n");
fflush(stdin);
cj=_getch();
}
while(cj=='y');
return 0;
}