Cod sursa(job #1116575)
Utilizator | Data | 22 februarie 2014 18:00:50 | |
---|---|---|---|
Problema | Factorial | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.28 kb |
#include<fstream>
using namespace std;
long long p,n,m=5,k;
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))m/=5,k++;
}while(k!=p);
fout<<n;
return 0;
}