Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = input("输入你的姓:")
- b = input("输入你的名:")
- print(a,b)
- ————————————
- a = eval(input("房间的长是多少:"))
- b = eval(input("房间的宽是多少:"))
- c=a*b
- print(c)
- - - - -
- 房间的长是多少:5
- 房间的宽是多少:6
- 30
- 这里面input取出来的值不能直接运算真蛋疼
- ————————————
- a = eval(input("房间的长是多少:"))
- b = eval(input("房间的宽是多少:"))
- c=a*b
- print(c)
- d = eval(input("地毯的价格是多少元每平方尺:"))
- print("总共需要",c,"平方米的地毯")
- e = c*9
- print("总共需要",e,"平方尺的地毯")
- f = e*d
- print("地毯总价格是",f,"元")
- - - - - - - -
- 房间的长是多少:5
- 房间的宽是多少:6
- 30
- 地毯的价格是多少元每平方尺:20
- 总共需要 30 平方米的地毯
- 总共需要 270 平方尺的地毯
- 地毯总价格是 5400 元
- ————————————————————
- a = eval(input("你有多少个五分硬币:"))
- b = eval(input("你有多少个二分硬币:"))
- c = eval(input("你有多少个一分硬币:"))
- d = a*5 + b*2 +c
- print("这些零钱的总面值是:",d)
- - - - - - - - - -
- 你有多少个五分硬币:3
- 你有多少个二分硬币:6
- 你有多少个一分硬币:8
- 这些零钱的总面值是: 35
- ——————————————————
Add Comment
Please, Sign In to add comment