Cod sursa(job #1114551)
Utilizator | Data | 21 februarie 2014 19:01:15 | |
---|---|---|---|
Problema | Factorial | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.29 kb |
#include<fstream>
using namespace std;
long long p,n,x,m;
int main()
{
ifstream fin("fact.in");
ofstream fout("fact.out");
fin>>p;
if(!p){fout<<1;return 0;}
do
{
n+=5;m=n;
while(!(m%5))x++,m/=5;
}while(x!=p);
fout<<n;
return 0;
}