Cod sursa(job #2513089)
Utilizator | Data | 22 decembrie 2019 13:11:36 | |
---|---|---|---|
Problema | Factorial | Scor | 10 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.28 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int p, i=1, s;
int main()
{
fin>>p;
while(p>0)
{
s+=p/i;
i*=5;
p/=5;
}
fout<<i;
return 0;
}