Cod sursa(job #3030137)

Utilizator aternativTanasi Robert aternativ Data 17 martie 2023 15:32:52
Problema Factorial Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.32 kb
#include <iostream>
using namespace std;

int main()
{
    long long p, j = 0, x5=0, aux, k = 0;
    cin >> p;
    while(x5 < p)
    {
        k = 0;
        j += 5;
        aux = j;
        while(aux % 5 == 0)
        {
            aux /= 5;
            k++;
        }
        x5 += k;
    }
    cout << j;
    return 0;
}