Cod sursa(job #2444290)
Utilizator | Data | 30 iulie 2019 22:40:53 | |
---|---|---|---|
Problema | Factorial | Scor | 20 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include <fstream>
using namespace std;
ifstream fin ("fact.in");
ofstream fout ("fact.out");
int main ()
{
long long P,auxP=0,i=1,N;
fin >> P;
if(P==0) fout<<1;
else{
while(auxP<P){
N=i;
while(N % 5 == 0){
N /= 5;
auxP++;
}
i++;
}
fout<<i-1;
}
}