Cod sursa(job #2652362)

Utilizator ionutdrg45Ionut Dragan ionutdrg45 Data 24 septembrie 2020 19:26:24
Problema Factorial Scor 15
Compilator py Status done
Runda Arhiva de probleme Marime 0.41 kb
read = open("fact.in", "r")
write = open("fact.out", "w")

def get_0(p):
    n = -1
    nr_zero = 0
    while nr_zero != p:
        n += 1
        aux_val = n
        while aux_val % 5 == 0 and aux_val:
            aux_val /= 5
            nr_zero += 1
    if n == -1:
        return 1
    else:
        return n

x = int(read.readline())

write.write(str(get_0(x)))

read.close()
write.close()