Cod sursa(job #1926972)
Utilizator | Data | 14 martie 2017 20:39:56 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include <bits/stdc++.h>
using namespace std;
int main()
{
ifstream f("fact.in");
ofstream g("fact.out");
int p,x=0,s=0,nrc5=0;
f>>p;
x=p*5;
if (p==0) {g<<1;return 0;}
while (p%5==0)
{
nrc5++;
p/=5;
}
x-=5*nrc5;
g<<x;
return 0;
}