Pagini recente » Cod sursa (job #3265575) | Cod sursa (job #2310757) | Cod sursa (job #2222899) | Cod sursa (job #1822547) | Cod sursa (job #2616550)
#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;
}
}