Cod sursa(job #1919472)
| Utilizator | Data | 9 martie 2017 19:37:38 | |
|---|---|---|---|
| Problema | Factorial | Scor | 5 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.3 kb |
#include <fstream>
using namespace std;
ifstream f("fact.in");
ofstream g("fact.out");
int main()
{
long long p,n,ni=1,r=1;
f>>p;
if(p==0)g<<1;
else
{
n=p*5;
while(ni*5<=n)
{
n+=r;r++;
ni*=5;
}
g<<n;
}
}
