Cod sursa(job #1742861)
Utilizator | Data | 17 august 2016 11:12:00 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.27 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int main()
{
long long p,n,i,x,nr;
fin>>p;
if (p==0) fout<<1;
for(i=1;x<p;i++)
{nr=5*i;
while(nr%5==0)
x++;nr/=5;
}
if(x==p) fout<<(i-1)*5;
}