Cod sursa(job #1965963)
Utilizator | Data | 14 aprilie 2017 19:40:46 | |
---|---|---|---|
Problema | Factorial | Scor | 25 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int P,N,nr;
int main()
{
fin>>P;
if (P<0) N=-1;
else
do
{
N++;
int c=N;
while(c%5==0)
{
c/=5;
nr++;
}
}
while(nr!=P);
fout<<N;
return 0;
}