Chinaunix首页 | 论坛 | 博客

分类: C/C++

2014-11-27 23:24:33


点击(此处)折叠或打开

  1. #include <stdio.h>
  2. int main()
  3. {
  4.     int    score;
  5.     scanf ("%d",&score);

  6.     if (score >    100)
  7.     {
  8.         printf ("you input the wrong scores \n");
  9.         return 0;
  10.     }
  11.     
  12.     else if (score < 0)
  13.     {
  14.         printf ("you input the wrong scores \n");
  15.         return 0;
  16.     }

  17.     
  18.     else if (score >= 90)
  19.     {
  20.         printf("the level of grade is 'A' \n ");
  21.     }
  22.     
  23.     else if (score >= 80)
  24.     {
  25.         if (score <= 89)
  26.         {
  27.             printf ("the level of grade is 'B' \n");
  28.         }
  29.     }
  30.     else if (score >= 70)
  31.     {
  32.         if(score <= 79)
  33.         {        
  34.             printf ("the level of grade is 'C' \n ");
  35.         }
  36.     }

  37.     else if (score >= 60)
  38.     {
  39.         if (score <= 69)
  40.         {
  41.             printf ("the level of grade is 'D' \n ");
  42.         }
  43.     }
  44.     else    
  45.     {
  46.         printf("the level of grade is 'E' \n ");
  47.     }
  48.     return 0;
  49. }

阅读(1439) | 评论(0) | 转发(0) |
0

上一篇:c 语言---练习题

下一篇:c语言---练习题

给主人留下些什么吧!~~