• 2021-04-14
    智慧职教:将下列程序补充完整,实现成绩等级输出。#include
    voidmain(){ int score;   printf("请输入课程成绩(整数):");   scanf("%d",_____________);   if(score>100||score<0) printf("输入错误!\n");   ___________           switch((int)_____________)           { case10:               case 9: printf("优秀!\n");_______________;               case 8: printf("良好!\n");break;               case 7: printf("中等!\n");break;               case 6: printf("及格!\n");break;               ___________: printf("不及格!\n");           }}5a0d99e305fecac500efc6ceb6743312198ebb4c0b8ac8d45ef1b9c6a80adc39a7be2ada98413e6c26c75ec4895239a23c5293ff6edff209abd64c9363088bbdf81f9a20a32b1b046de18a8f04c74749
  • &scoreelsescore/10breakdefault

    内容

    • 0

      下列程序的输出结果是_____________ main() { int a=1,b=0; switch(a) { case 1: switch (b) { case 0: printf("**0**"); break; case 1: printf("**1**"); break; } case 2: printf("**2**"); break; } }

    • 1

      以下程序运行后的输出结果是______。 void main() { int s=0,k; for(k=7; k>=0; k--) { switch(k) { case 1: case 4: case 7: s++; break; case 2: case 3: case 6: break; case 0: case 5: s+=2; break; } } printf("s=%d\n",s); }

    • 2

      #include main()_ { char grade=’C’; switch(grade) { case ‘A’: printf(“90-100\n”); case ‘B’: printf(“80-90\n”); case ‘C’: printf(“70-80\n”); case ‘D’: printf(“60-70\n”); break; case ‘E’: printf(“<60\n”); default : printf(“error!\n”); } } 运行结果为( )

    • 3

      执行语句序列 int n; scanf("%d",&n); switch(n) { case 1: printf("%c ",'1'); case 3: case 4: printf("%c ",'2');; break; default: printf("%c ",'3'); } 时,若键盘输入1,则屏幕显示【 】

    • 4

      若有以下定义,则正确的switch语句是______。float x;int a,b; A: switch(x) B: case 1.0:printf("*\n"); C: csse 2.0:printf("**\n"); D: switch(x) E: case 1,2:printf("*\n"); F: case 3:printf("**\n"); G: switch(a+b) H: case 1:printf("\n"); I: case 1+2:printf("**\n"); J: switch(a+b); K: case 1:printf("*\n"); L: case 2:printf("**\n");