Cod sursa(job #2569765)
Utilizator | Data | 4 martie 2020 13:35:59 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include <iostream>
#include <fstream>
using namespace std;
int y,x,nr=0,n;
ifstream fin("fact.in");
ofstream fout("fact.out");
int main()
{
fin>>n;
y=5;
x=5*n;
while (y<=x)
{
nr++;
y=y*5;
}
nr--;
x=x-(5*nr);
fout<<x;
return 0;
}