Pagini recente » Cod sursa (job #110367) | Cod sursa (job #1130225) | Cod sursa (job #60924) | Cod sursa (job #1233441) | Cod sursa (job #2616556)
#include<iostream>
#include<fstream>
using namespace std;
fstream fin("fact.in", ios::in);
fstream fout("fact.out", ios::out);
int main()
{
ios::sync_with_stdio(false);
unsigned int p; fin>>p;
if(p == 0)
fout<<1;
else
{
long long unsigned int i = 5;
long long unsigned int counter = 0;
for(;counter <= p; i+=5)
{
long long unsigned cop = i;
while(cop % 5 == 0)
{
counter ++;
cop /= 5;
}
//cout<<counter<<"\n";
}
fout<<i - 5;
}
}