Cod sursa(job #2289828)
Utilizator | Data | 25 noiembrie 2018 13:11:21 | |
---|---|---|---|
Problema | Factorial | Scor | 30 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int main()
{
int a,nr=0,x,c;
fin >>x;
a=0;
while (nr<=x)
{
a=a+5;
c=a;
while (c%5==0)
{
nr++;
c=c/5;
}
if (nr==x) break;
}
if (x!=0) fout <<a;
else fout<<"1";
return 0;
}