Flower Pruning

Bai tap tia hoa
 avatar
minhthu1902
python
2 years ago
444 B
0
Indexable
Never
# Bai tap tia hoa
# n = int(input())
#Kiem tra n voi x
#Neu n > x....
#Neu n < x thi ...
n = int(input())
h= [1000]
min = 1000
# Tim t min height
for i in range (1, 1000):
    if h[i] > min:
        h[i] = min
#Tinh sum tu chieu cao toi thieu
sum = 0 # tao 1 bien de tinh sum
#duyet qua cac phan tu cua mang h, lay ra nang luong can tia cho cay
while h[i]== min:
    nangLuong[i] = h[i]- min
    sum += nangLuong[i]
print(sum)