Cod sursa(job #1092826)
Utilizator | Data | 27 ianuarie 2014 14:42:57 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.53 kb |
#include <fstream>
using namespace std;
int main()
{ ifstream f("fact.in");
ofstream g("fact.out");
int aux,c,r,sem,i;
long p;
long long n;
while("!f.eof")
{f>>p;sem=1;n=1;
while(sem!=0)
{for(i=1;i<=n;i++)
n*=i;
aux=n;
r=0;
while (aux!=0)
{c=aux%10;
if(c==0)
r++;
aux=aux/10;
}
if(r==p)
{g<<n<<'\n';
sem=0;
}
}
}
return 0;
}