Cod sursa(job #2936361)

Utilizator AlexandruCorneaCornea Alexandru Mihai AlexandruCornea Data 8 noiembrie 2022 18:45:19
Problema Factorial Scor 5
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.29 kb
#include <fstream>

using namespace std;
ifstream fin ("fact.in");
ofstream fout ("fact.out");
int main()
{
    long long n=21,s=-1,p,x;
    fin>>x;
    while (s!=x)
    {
   n++;
    p=5;
    s=0;
    while(p<=n){
        s+=n/p;
        p*=5;}
    }
    fout<<n;
    return 0;
}