kk258966

3/19 C++ 練習三

Mar 19th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 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. if(GPA=='A')
  13. {
  14.             printf("成績範圍超過80分~YAAAAA~\n");
  15.             }
  16. else if(GPA=='B')
  17. {
  18.             printf("成績範圍70~80分~MMMM~\n");
  19.             }
  20. else if(GPA=='C')
  21. {
  22.             printf("成績範圍60~70分~AHHHHHH~\n");
  23.             }
  24. else if(GPA=='D')
  25. {
  26.      printf("成績不及格~NOOOOOO~\n");
  27.      }
  28.      else
  29.      {
  30.          printf("混蛋!!!別亂輸入!!!!\n");
  31.          }
  32.  
  33. printf("===========================\n") ;
  34.  
  35.  
  36.     system("pause");
  37.     return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment