加油站
来源:互联网 发布:联淘宝 编辑:程序博客网 时间:2024/04/27 17:46
简单的输入输出 强制类型转换 课后题
x=float(raw_input("Size of tank: "))y=float(raw_input("precent of full: "))z=float(raw_input("km per liter: "))p=x*(y/100)*zif p>=200: print "You can get another ",p," km" print "The next gas station is 200 km away" print "You can wait for the next station"else: print "You can get another ",p," km" print "The next gas station is 200 km away" print "Get gas now"
输入出结果:
>>> ================================ RESTART ================================>>> Size of tank: 60precent of full: 40km per liter: 10You can get another 240.0 kmThe next gas station is 200 km awayYou can wait for the next station>>>
>>> ================================ RESTART ================================>>> Size of tank: 60precent of full: 30km per liter: 80You can get another 1440.0 kmThe next gas station is 200 km awayYou can wait for the next station
- 加油站
- 加油站
- 加油站
- 加油站...
- 加油站
- 加油站
- 加油站
- 加油站
- 加油站
- 加油站
- 加油站
- 加油站加油
- 加油站问题
- 加油站问题
- 程序员加油站
- 加油站问题
- LintCode-加油站
- 题目:加油站
- Flexviewer两个widget间的如何传值
- 往前走吧,管它未来是什么!!
- 新的开始
- 在 Linux 中自动生成 Cordova/Phonegap for Android 的 APK 安装程序
- ajax问题
- 加油站
- matlab矩阵抽取截取删除及叠加
- 开源WAF之初衷
- android引导页的实现 及跳转到主页面
- 《hadoop权威指南》学习笔记
- 寻找最大(小)的K个数
- sed 简明教程
- 朴素贝叶斯文本分类
- 网络基础知识学习4-PPP协议