Cod sursa(job #1195559)
Utilizator | Data | 7 iunie 2014 21:48:38 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main()
{int long long N,P,x,t;
N=1;
x=0;
ifstream f("factin.txt");
ofstream g("factout.txt");
f>>P;
while (x<P)
{t=N;
while (t!=0)
{if (t%5==0) x=x+1;
t=t/5;}
N=N+1;}
if (x==P) g<<N-1;
f.close();
g.close();
return 0;
}