Cod sursa(job #667163)

Utilizator MutescuMutescu Alexandru Mutescu Data 22 ianuarie 2012 17:54:25
Problema Factorial Scor 10
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.34 kb
#include<fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
unsigned int N=2,j;
long int h;
int P,i,m;
int main(){
f>>P;
h=N*2;
for(N=1;N<=h;N++){
	h=N*2;
	if((N%5==0)&&(N!=0)){
		if(N%25==0)
			m=m+2;
		else
			m++;
		}
	if(m==P){
		g<<N;
		h=N-1;}
	if(m>P){
		g<<-1;
		h=N-1;}}

return 0;}