简单的switch语句

#include <stdio.h>
#include <stdlib.h>
int main()
{
    char ch;
    //scanf("%c",&ch);
    ch=getchar();
    switch(ch)
    {
        case 'A':printf("成绩为90分以上\n");break;
        case 'B':printf("成绩在80-90分之间\n");break;
        case 'C':printf("成绩在70-80分之间\n");break;
        case 'D':printf("成绩在60-70分之间\n");break;
        case 'E':printf("不好意思你没有及格\n");break;
        default:printf("输入数据错误\n");
    }
}

posted @ 2013-06-01 10:14  时间淡无痕  阅读(193)  评论(0编辑  收藏  举报