Cod sursa(job #23684)
Utilizator | Data | 1 martie 2007 10:35:15 | |
---|---|---|---|
Problema | Factorial | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.27 kb |
#include <fstream.h>
int main(){
unsigned long N,p,i,aux;
int k;
ifstream f("fact.in");
ofstream g("fact.out");
f>>p;
k=0;i=1;
while(k<p){
if(i%5==0){
aux=i;
while(aux%5==0){
aux/=5;
k++;
}
}
++i;
}
g<<i-1;
return 0;
}