对输入的成绩进行等级划分

二、分析

    使用if-else嵌套语句时必须注意else与if的配对正确

三、源码

#include <stdio.h>
   2:  
int main()
   4: {
int nScore;
);
, &nScore);
if (nScore < 80)
   9:     {
if (nScore < 70)
  11:         {
if (nScore < 60)
  13:             {
);
  15:             }
else
  17:             {
);
  19:             }
  20:         }
else
  22:         {
);
  24:         }
  25:     }
else
  27:     {
if (nScore < 90)
  29:         {
);
  31:         }
else
  33:         {
);
  35:         }
  36:     }
  37:     getchar();
return 0;
  39: }

相关文章: