Cod sursa(job #464240)

Utilizator ionut2219Muresanu Gabriel Ionut ionut2219 Data 19 iunie 2010 14:42:28
Problema Factorial Scor 25
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.29 kb
#include<iostream.h>
#include<fstream.h>
main()
{ long n,p,i,c,ok=1,ok2,ci;

ifstream f("fact.in");
ofstream g("fact.out");

f>>p;
c=0;
i=0;
while(ok==1)
{ i++;ok2=1;
	ci=i;
	while(ci!=0 && ok2==1)
 {if(ci%5==0)c++;
	else ok2=0;
 if(c==p)ok=0;
   ci=ci/5;
 }

}
n=i;
g<<n;
}