c语言 自动喊话,帮忙做几道C语言的题

满意答案

dcebd7a0de6265b6ccae5ead692f1eab.png

blg953374

2013.01.02

dcebd7a0de6265b6ccae5ead692f1eab.png

采纳率: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分享举报

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值