满意答案
blg953374
2013.01.02
采纳率:51% 等级:12
已帮助:6262人
题1:
#include
int main()
{
int year=0,money=0,temp=0;
printf("Please input product witch place made in:\n");
printf("1------------------Made in Our company.\n");
printf("2------------------Made in other company.\n");
scanf("%d",&temp);
switch(temp)
{
case 1: printf("Please input how many year you use this company:\n");
scanf("%d",&year);
if(year>=0&&year<=1) {money=0; printf("Protect to fix a fee is %d\n",money);}
else if(year>1&&year<=8){money=50;printf("Protect to fix a fee is %d\n",money);}
else {money=10;printf("Protect to fix a fee is %d\n",money);}
break;
case 2: money=200;
printf("Protect to fix a fee is %d\n",money);
break;
default: printf("input error!\n");
}
return 0;
题2:
#include
int main()
{
int egg_num=0;
float fee=0.4,money;
for(egg_num=0;;egg_num++)
{
if((egg_num%2==1&&egg_num%3==2&&egg_num%4==3&&egg_num%5==4)) break;
}
money=fee*egg_num;
printf("The number of eggs is %d.\n",egg_num);
printf("The man shuold pay %f$.\n",money);
return 0;
}
题3:#include
int main()
{
float lenth,width,height;
double volume;
printf("Please input lenth、width and height:\n");
scanf("%f %f %f",&lenth,&width,&height);
volume=lenth*width*height;
printf("The volume is %f.\n",volume);
return 0;
}
题4:#include
int main()
{
float temperature;
double temperature1;
printf("Please input the temperature:\n ");
scanf("%f",&temperature);
temperature1=(float)(9/5)*temperature+32;
printf("The temperature you want is %f.\n",temperature1);
return 0;
}
题5:
#include
int main()
{
int s=1,n=1;
for(n=1;n<=4;n++)
s=s*n;
printf("4!=%d\n",s);
s=s*5;
printf("5!=%d\n",s);
return 0;
}
00分享举报