Cod sursa(job #126930)
Utilizator | Data | 22 ianuarie 2008 23:15:15 | |
---|---|---|---|
Problema | Factorial | Scor | 50 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include <fstream.h>
#include <iostream.h>
int main()
{
ifstream fin("fact.in");
ofstream fout("fact.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;
}