Cod sursa(job #2211959)

Utilizator iramIoana Popa iram Data 12 iunie 2018 17:03:04
Problema Factorial Scor 35
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.44 kb
#include <fstream>
#include <iostream>

using namespace std;

ifstream fin("fact.in");
ofstream fout("fact.out");

int main()
{
    int n,p,cop,f5;
    fin>>p;

    n=5;
    f5=0;
    while (1)
    {
        cop=n;
        while (cop%5==0)
        {
            f5++;   cop/=5;
        }

        if (f5==p)
        {
            fout<<n;
            cout<<n;
            return 0;
        }
        n+=5;
    }

}