11 lines
267 B
Python
11 lines
267 B
Python
blocchi = int(input("Quanti blocchi hai? "))
|
|
|
|
strati = 0
|
|
blocchi_usati = 0
|
|
|
|
while blocchi_usati + strati + 1 <= blocchi:
|
|
strati += 1
|
|
blocchi_usati += strati
|
|
|
|
print("L'altezza della piramide è", strati, "usando", blocchi_usati, "blocchi")
|