#include<stdio.h>#include<stdlib.h>int main(){?float grades;?scanf("%f",&grades);?switch ((int)grades / 10);?{?case 10:?case 9:??printf("A\n");?case 8:??printf("B\n");?case 7:??printf("C\n");?default:??printf("D\n");?}?system("pause");?return 0;}
2 回答
已采納

JustWannaHugU
TA貢獻(xiàn)452條經(jīng)驗(yàn) 獲得超796個(gè)贊
騷年,細(xì)節(jié)是魔鬼。
#include<stdio.h> #include<stdlib.h> int?main() { ?float?grades; ?scanf("%f",&grades); ?switch?((int)grades?/?10)//你是不是多大個(gè)分號(hào)? ?{ ?case?10: ?case?9: ??printf("A\n"); ?case?8: ??printf("B\n"); ?case?7: ??printf("C\n"); ?default: ??printf("D\n"); ?} ?system("pause"); ?return?0; }
望采納
- 2 回答
- 0 關(guān)注
- 1632 瀏覽
添加回答
舉報(bào)
0/150
提交
取消