mshd.net
当前位置:首页 >> C语言给出一百分制成绩,要求输出成绩等级'A','B','... >>

C语言给出一百分制成绩,要求输出成绩等级'A','B','...

#include main() { int iNum; sacnf("%d", &iNum); switch (iNum / 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;...

#include int main() { float score; char grade; printf("请输入学生成绩:"); scanf("%f",&score); while(score>100||score

#includeint main() { int grade; scanf("%d",&grade); printf("your grade:"); switch((int)grade/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...

#include int main() { printf("请输入分数:"); char szscore[2+1] = {0}; scanf("%s", &szscore); printf("等级为:"); switch (*szscore) { case '9' : printf("A\n"); break; case '8' : printf("B\n"); break; case '7' : printf("C\n"); bre...

你输入case 以后要空一格再输入数字 case才会变蓝、 这样就可以了

#include int main() { int x; printf("输入成绩:"); scanf("%d",&n); if(n>=90) printf("A"); esle if(n>=80) printf("B"); esle if(n>=70)printf("c"); esle if(n>=60) printf("D"); esle printf("E"); return 0; }

void f1(int score){ int rate = score/10; switch(rate) { case 10: putchar('A'); break; case 9: putchar('A'); break; case 8: putchar('B'); break; case 7: putchar('C'); break; case 6: putchar('D'); break; default: putchar('E'); } ...

#include int main() { int a; printf("输入你的成绩:"); scanf("%d",&a); if(a>100||a

#include int main(void){ int num ; scanf("%d",&num); if(num >= 90 && num = 80 && num = 70 && num = 60 && num = 0 && num

#include int main (){float s=1;int n;char ch;scanf("%f",&s);//输入成绩n=s/10;//除以10转为个位数,如:98/10取整后n=9switch(n){case 10:case 9:ch='A';break;//90+包括100都是A,所以case10不用breakcase 8:ch='B';break;case 7:ch='C';bre...

网站首页 | 网站地图
All rights reserved Powered by www.mshd.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com