kk258966

3/26 c++練習一

Mar 26th, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.63 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main(void)
  4. {
  5. char GPA;
  6. printf("請輸入考績等別‧\n");
  7. scanf("%c",&GPA);
  8. printf("%c已輸入‧\n",GPA);
  9.  
  10. printf("============================\n");
  11.  
  12. switch (GPA)
  13. {
  14.        case 'A':printf("成績範圍超過80分\n");
  15.        break;
  16.  
  17.        case 'B':printf("成績範圍70~80分\n");
  18.        break;
  19.  
  20.        case 'C':printf("成績範圍60~69分\n");
  21.        break;
  22.  
  23.        case 'D':printf("成績不及格\n");
  24.        break;
  25.        
  26.        default :printf("勿亂輸入\n");
  27.        }
  28.  
  29. printf("============================\n");
  30.  
  31.  
  32.     system("pause");
  33.     return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment