Cod sursa(job #972608)
| Utilizator | Data | 12 iulie 2013 11:15:57 | |
|---|---|---|---|
| Problema | Factorial | Scor | 20 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.28 kb |
#include <fstream>
using namespace std;
int main()
{
long long p;
int zeros=0,i,j;
ifstream fin("fact.in");
ofstream fout("fact.out");
fin>>p;
for(i=0;zeros<p-1;i=i+5)
{
j=i;
while(j%5==0 && j!=0)
{
zeros++;
j=j/5;
}
}
if(p==0) fout<<"1";
else fout<<i;
return 0;
}
