switch语句实例。。

#include <stdio.h>

  int main()
  {
  char grade  ='B' :
  switch (grade){
case'A':
        printf(Excellent!\n);
          break;
          case'B':
          case'C':
          printf("Well done\n");
          break;
          case'D':
          printf("You passed\n");
          break;
          case 'F':
printf("Better  try again\n");
 break;
   default;
      printf("Invalid grade\n")
      }
      printf("Your grade is %c\n",grade);
      return;
}
©️2020 CSDN 皮肤主题: 1024 设计师:上身试试 返回首页