Chinaunix首页 | 论坛 | 博客

分类: C/C++

2014-11-27 13:08:07


点击(此处)折叠或打开

  1. #include <stdio.h>
  2. int main()
  3. {
  4.     float math,chinese,physic,chemistry,sum;
  5.     int select;
  6.     math =138;
  7.     chinese =59;
  8.     physic =98;
  9.     chemistry =100;
  10.     
  11.     scanf("%d",&select);
  12.     if ( select==1)
  13.     {
  14.         printf("the math is:%f\n",math);
  15.     }
  16.     else if (select==2)
  17.     {
  18.         printf("the chinese is:%f\n",chinese);
  19.     }
  20.     else if (select==3)
  21.     {
  22.         printf("the physic is :%f\n",physic);
  23.     }
  24.     else if (select==4)
  25.     {
  26.         printf("the chemistry is:%f\n",chemistry);
  27.     }
  28.     else
  29.     {
  30.         printf("the sum is:%f\n",sum);
  31.     }
  32.     return 0;
  33. }

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

上一篇:c语言---减法

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

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