#include<stdio.h>
int main()
{
int score,mark;
printf("Please enter score:");
scanf("%d",&score);
mark=score<0||score>100?-1:score/10;
switch(mark)
{
case 10:
case 9:printf("%d--A\n",score);
break;
case 8:printf("%d--B\n",score);
break;
case 7:printf("%d--C\n",score);
break;
case 6:printf("%d--D\n",score);
break;
case 5:
case 4:
case 3:
case 2:
case 1:
case 0:printf("%d--E\n",score);
break;
default:printf("Input error!\n");
}
return 0;
}
![这里写图片描述](http://img.blog.csdn.net/20180102171814305?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvWEcxN18zODI0MTQxNzE0NQ==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
心得体会:(1)掌握程序基本结构。
(2)掌握函数基本知识。