Cod sursa(job #2780507)
Utilizator | Data | 7 octombrie 2021 10:14:23 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
unsigned long long n,i,p,S;
int main()
{
fin>>n;
i=0;
p=0;
while(p<=n)
{
i=S+5;
S=i;
while(i%5==0)
{
i=i/5;
p++;
}
}
cout<<S-5;
return 0;
}