Cod sursa(job #2623159)
| Utilizator | Data | 2 iunie 2020 18:06:50 | |
|---|---|---|---|
| Problema | Factorial | Scor | 30 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.47 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int p, d, i, nr;
int main()
{
fin>>p;
if(p==0)
fout<<1;
else
{
i=1;
nr=0;
while(i<=p)
{
nr+=5;
d=25;
while(nr%d==0)
{
i++;
d=d*5;
}
i++;
}
fout<<nr;
}
}
