【c语言】给出100分制成绩,要求输出成绩等级A,B,C,D,E。90分以上为A,80~89位B,70~79位C ,60~69位D,60以下为E

// 给出100分制成绩,要求输出成绩等级A,B,C,D,E。90分以上为A,80~89位B,70~79位C ,60~69位D,60以下为E

#include <stdio.h>

int main()
{
	int a;
	printf("请输入成绩:");
	scanf("%d",&a);
	if(a >= 90)
		printf("等级是A\n");
	else if(a >= 80 && a <= 89)
		printf("等级是B\n");
	else if(a >= 70 && a <= 79)
		printf("等级是C\n");
	else if(a >= 60 && a <= 69)
		printf("等级是D\n");
	else
		printf("等级是E\n");

	return 0;
}

<img src="https://img-blog.csdn.net/20150423122823909?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvemhhb3lhcWlhbjU1Mg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />

<img src="https://img-blog.csdn.net/20150423122831616?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvemhhb3lhcWlhbjU1Mg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />

<img src="https://img-blog.csdn.net/20150423122839182?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvemhhb3lhcWlhbjU1Mg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />

<img src="https://img-blog.csdn.net/20150423122847122?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvemhhb3lhcWlhbjU1Mg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />

<img src="https://img-blog.csdn.net/20150423123017172?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvemhhb3lhcWlhbjU1Mg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />


©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页