Cod sursa(job #32947)

Utilizator RobytzzaIonescu Robert Marius Robytzza Data 18 martie 2007 19:01:52
Problema Factorial Scor 10
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");
short 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;
}