求各位大神把下面的C语言程序编码翻译成python语言,谢谢的!!急呀!!

#include<stdio.h>intmain(){intnum1,num2,num3;doublesum1,sum2,sum3,sum;chara[10],b[10]... #include<stdio.h>
int main()
{
int num1,num2,num3;
double sum1,sum2,sum3,sum;
char a[10],b[10],c[10];
printf("please input the first thing you want to buy\n");
gets(a);
puts(a);
printf("please input the number you need\n");
scanf("%d\n",&num1);
sum1=num1*4.5;
printf("the price is %f\n",sum1);

printf("please input the second thing you want to buy\n");

gets(b);
puts(b);
printf("please input the number you need\n");
scanf("%d\n",&num2);
sum2=num2*5.5;
printf("the price is %f\n",sum2);

printf("please input the third thing you want to buy\n");

gets(c);
puts(c);
printf("please input the number you need\n");
scanf("%d\n",&num3);
sum3=num3*5.5;
printf("the price is %f\n",sum3);

sum=sum1+sum2+sum3;
printf("the final price is %f",sum);
return 0;
}
展开
 我来答
天刚没亮
推荐于2016-07-31
知道答主
回答量:9
采纳率:0%
帮助的人:10.3万
展开全部
price1 = 4.5
price2 = 5.5
price3 = 5.5
thing1 = raw_input('please input the first thing you wang to bug\n')
print thing1
num1 = int(raw_input('please input the number you need\n'))
print num1
print 'the price is %f' % float(num1*price1)
thing2 = raw_input('please input the first thing you wang to bug\n')
print thing2
num2 = int(raw_input('please input the number you need\n'))
print num2
print 'the price is %f' % float(num2*price2)
thing3 = raw_input('please input the first thing you wang to bug\n')
print thing3
num3 = int(raw_input('please input the number you need\n'))
print num3
print 'the price is %f' % float(num3*price3)
print 'the final price is %f' % float(num1*price1+num2*price2+num3*price3)
追问
谢谢你呀大神
本回答被提问者和网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
匿名用户
2015-12-10
展开全部
很愿意帮助你完成方面其他方式交流吗
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式