Cod sursa(job #679590)
Utilizator | Data | 13 februarie 2012 15:26:21 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include <iostream.h>
#include <fstream.h>
long i = 1, o, count, p;
int main()
{
ifstream f ("factorial.in");
ofstream g ("factorial.out");
f >> p;
while(1)
{
o = i;
while(o % 5 == 0)
{
o /= 5;
count ++;
}
if(count == p)
break;
i ++;
}
g << i;
}