Cod sursa(job #1238210)
Utilizator | Data | 5 octombrie 2014 22:51:31 | |
---|---|---|---|
Problema | Factorial | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.32 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int main()
{long long p,s=0,i=5,ci;
fin>>p;
while(s<p)
{ci=i;
while(ci%5==0)
{ci=ci/5;
s++;
}
i+=5;
}
if(p==0) fout<<i-4;
else fout<<i-5;
return 0;
}