在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
输入一个考试成绩,90~100输出A,80~90输出B,70~80输出C,60~70输出D,60以下输出E 代码: #include<stdio.h> int main() { float score; printf("Enter a score:"); scanf("%f",&score); int n; n=score/10; switch(n){ 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; case 5: case 4: case 3: case 2: case 1: case 0: printf("E\n"); break; } } default子句可以省略不用 |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论