Cod sursa(job #32944)
Utilizator | Data | 18 martie 2007 19:00:13 | |
---|---|---|---|
Problema | Factorial | Scor | 45 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.27 kb |
#include<fstream.h>
int main(){
ifstream fin("fact.in");
ofstream fout("fact.out");
long int P,nr=0,x=0,N=0;
fin>>P;
while (N!=P){
x+=5;
nr=x;
while (nr%5==0){
nr/=5;
N++;}
}
fout<<x;
fin.close();
fout.close();
return 0;
}