Cod sursa(job #139124)
Utilizator | Data | 19 februarie 2008 19:06:22 | |
---|---|---|---|
Problema | Factorial | Scor | 45 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include<fstream.h>
#include<iostream.h>
int main()
{long p,n,tt,t,k5;
ifstream in("fact.in");
ofstream out("fact.out");
in>>p;
in.close();
k5=0;
t=0;
do {
t+=5;
tt=t;
while(tt%5==0)
{tt=tt/5;
k5++;}
}while(k5!=p);
out<<t;
out.close();
return 0;
}