Pagini recente » Diferente pentru problema/antocod intre reviziile 5 si 4 | Cod sursa (job #1774507) | Cod sursa (job #1774520) | Cod sursa (job #2845027) | Cod sursa (job #2681359)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("fact.in");
ofstream fout("fact.out");
int n;
int p;
int nr5;
int main()
{
fin >> p;
int j = 1;
if (p == 0)
fout << 1;
else
{
while (nr5 < p)
{
n += 5;
nr5++;
if (j % 5 == 0)
{
int x = j;
while (x % 5 == 0)
{
x /= 5;
nr5++;
}
}
j++;
}
fout << n;
}
fin.close();
fout.close();
return 0;
}