Pagini recente » Cod sursa (job #1795892) | Cod sursa (job #2778044) | Cod sursa (job #1801353) | Cod sursa (job #1922200) | Cod sursa (job #2616559)
#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;
}
}