Cod sursa(job #553821)

Utilizator c.danCristescu Daniel c.dan Data 14 martie 2011 12:46:10
Problema Factorial Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.41 kb
#include <fstream>
#include <iostream>
using namespace std;
int main ();

{int i,j,k,g,l,s,P,c,t,f;
ifstream f("fact.in");
ofstream g("fact.out");
f>>P;
for(i=1;i<=31000;i++)
	for(j=1;j<=i;j++)
	{	{t=j;k=0;l=0;s=0;
	     while(t!=0)
			{ c=t%10;
		     if (c==2) k++;
			 if(c==5) l++;
			 if(c==0) s++;
			}
		if(k>l) k=l;
		if(P==k+s) g<<i;}
	
f.close ();
g.close();
return 0; 
	}