回覆列表
  • 1 # hkpun445

    #include<stdio.h>voidmain(){intscore;scanf("%d",&score);switch(score/10){case10:printf("A\n");/*100分和90分之間的等級是一樣的,所以不加break。*/case9:printf("A\n");break;/*90分和80分等級不同,所以加break,表示選擇了之後就跳出選擇了。*/case8:printf("B\n");break;/*與上面一樣*/case7:printf("C\n");break;case6:printf("D\n");break;case5:printf("E\n");/*50到0的等級一樣,所以不加break*/case4:printf("E\n");case3:printf("E\n");case2:printf("E\n");case1:printf("E\n");case0:printf("E\n");break;}}/*(就是將100到0這區間上的分數分為五個等級);*/#include<stdio.h>voidmain(){intscore;scanf("%d",&score);if(score>=90&&score<=100)printf("A\n");elseif(score>=80&&score<=89)printf("B\n");elseif(score>=70&&score<=79)printf("C\n");elseif(score>=60&&score<=69)printf("D\n");elseif(score>=0&&score<=59)printf("E\n");}

  • 中秋節和大豐收的關聯?
  • 求魔獸DZ副本高輸出的戰鬥匕首天賦加點?