Cod sursa(job #560991)
Utilizator | Data | 18 martie 2011 19:46:39 | |
---|---|---|---|
Problema | Factorial | Scor | 15 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include<fstream.h>
#include<iostream.h>
#include<climits>
int nrz(int n)
{
if(n==0)
return n;
return nrz(n/5)+n/5;
}
int main()
{
ifstream fin("fact.in");
ofstream fout("fact.out");
int p,n,i=1;
fin>>p;
while(1)
{
if(nrz(i)==p)
{fout<<i; break;}
i++;
}
return 0;
}