Cod sursa(job #428536)
Utilizator | Data | 29 martie 2010 12:38:38 | |
---|---|---|---|
Problema | Factorial | Scor | 45 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.27 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main ()
{
int p,n=0,nr;
ifstream fin("fact.in");
ofstream fout("fact.out");
fin>>p;
while (p)
{
n+=5;
nr=n;
while (nr%5==0)
{
p-=1;
nr/=5;
}
}
fout<<n;
return 0;
}