分类: 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;
}