Chinaunix首页 | 论坛 | 博客

分类: C/C++

2014-11-28 18:13:11

#include
int main()
{
 float shuxue, yuwen, wuli, huaxue;
 float sum;

 int select;

 shuxue=134;
 yuwen=111;
 wuli=99;
 huaxue=100;
 scanf ("%d",&select);
 switch(select)
 {
  case 1:
  printf("shuxuechengjishi%.1f\n",shuxue);
  break;
 

  case 2:
 
  printf("yuwenchengjishi%.1f\n",yuwen);
  break;
 

 
  case  3:
 
  printf("wulichengjishi%.1f\n",wuli);
  break;
 

 
  case 4:
 
  printf("huaxuechengjishi%.1f\n",huaxue);
  break;
 

 
 default:
 
   sum=shuxue+yuwen+wuli+huaxue;
   printf("sumshi:%.1f\n",sum);
  break;
 }
  return 0;
}
    

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

上一篇:用c做的题

下一篇:c语言习题

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