Відповідь:
N = int(input("Enter the number of trucks: "))
weights = []
for i in range(N):
weight = float(input("Enter the weight in tons of truck {}: ".format(i+1)))
weights.append(weight)
K = float(input("Enter the weight in tons of the crushed stone: "))
total_capacity = sum(weights)
if total_capacity >= K:
print("The given trucks can transfer a volume of crushed stone weighing {} tons at one time.".format(K))
else:
print("The given trucks cannot transfer a volume of crushed stone weighing {} tons at one time.".format(K))
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Відповідь:
N = int(input("Enter the number of trucks: "))
weights = []
for i in range(N):
weight = float(input("Enter the weight in tons of truck {}: ".format(i+1)))
weights.append(weight)
K = float(input("Enter the weight in tons of the crushed stone: "))
total_capacity = sum(weights)
if total_capacity >= K:
print("The given trucks can transfer a volume of crushed stone weighing {} tons at one time.".format(K))
else:
print("The given trucks cannot transfer a volume of crushed stone weighing {} tons at one time.".format(K))