Cod sursa(job #126929)
Utilizator | Data | 22 ianuarie 2008 23:13:54 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include <fstream.h>
#include <iostream.h>
int main()
{
ifstream fin("factorial.in");
ofstream fout("factorial.out");
int n=0,b,ct=0,p;
fin>>p;
while (ct<p)
{
n=n+5;
b=n;
while (b%5==0)
{
b=b/5;
ct=ct+1;
}
}
if (p==0) n=1;
fout<<n;
return 0;
}