学生成绩分类(等级)

#include 
#include 

int main()
{
   int score;
   scanf ("%d",&score);
   if(score<=100&&score>=0)
   {switch (score/10)
    {
       case 10:
       case 9:printf("A\n");break;
       case 8:printf("B\n");break;
       case 7:printf("C\n");break;
       case 6:printf("D\n");break;
       default :printf("E\n");break;
    }
   }else printf("error\n");
    return 0;
}

你可能感兴趣的:(小白,c语言)