import math
area = int(input('Enter the surface area'))
rate = int(input('Enter the surface rate'))
coats = int(input('Enter the surface coats'))
volume = int(input('Enter the surface volume'))
ret = (area/rate*coats)/volume
print(f'{math.ceil(ret)} cans are required.')
输入的第一个数除以第二个数,乘以第三个数,除以第四个数,向上取整。
import math
n1=float(input('Enter the surface area:'))
n2=float(input('Enter the paint spreading rate:'))
n3=float(input('Enter the number of coats:'))
n4=float(input('Enter the paint can volume:'))
print('%d cans are required.'% math.ceil(n1*n3/n2/n4))
您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!from math import ceil
surface_area = float(input("Enter the surface area:"))
spreading_rate = float(input("Enter the spreading rate:"))
number_coats = float(input("Enter the number of coats:"))
volume = float(input("Enter the paint can volume:"))
cans = ceil((surface_area / spreading_rate) * number_coats) / volume
print(f'{int(cans)} cans are required.')