Pagini recente » Cod sursa (job #1625626) | Cod sursa (job #1174295) | Cod sursa (job #285330) | Cod sursa (job #128731) | Cod sursa (job #1004291)
//
// main.cpp
// ex2
//
// Created by Alexandru Bagu on 02.10.2013.
// Copyright (c) 2013 Alexandru Bagu. All rights reserved.
//
#include <iostream>
#include <fstream>
using namespace std;
typedef long long int ulint;
int main(int argc, const char * argv[])
{
ifstream fin("fact.in");
int k;
fin>>k;
ulint n = 0;
ulint m = 0;
ulint aux = 0;
while(m < k)
{
n+=5;
m++;
aux = n;
while((aux / 5) % 5 == 0)
aux/=5, m++;
}
ofstream fout("fact.out");
fout<<n<<endl;
return 0;
}