Cod sursa(job #1316779)
Utilizator | Data | 14 ianuarie 2015 09:18:08 | |
---|---|---|---|
Problema | Factorial | Scor | 15 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include <fstream>
using namespace std;
int main()
{
ifstream f("fact.in");
ofstream g("fact.out");
int p,n=1,i,q=0,x,p1;
f >> p;
while (q!=p)
{
q = 0 ;p1=1;
while (n/p1){p1=p1*5;q=q+n/p1;}
if (q!=p) {n++;q=0;p1=1;}
}
g << n;
return 0;
}