Cod sursa(job #1965957)
Utilizator | Data | 14 aprilie 2017 19:35:59 | |
---|---|---|---|
Problema | Factorial | Scor | 25 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int P;
int main()
{
fin>>P;
int N=0,nr=0;
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;
}