Pagini recente » Borderou de evaluare (job #610439) | Cod sursa (job #2460800) | Cod sursa (job #895899) | Cod sursa (job #3227703) | Cod sursa (job #1480493)
#include <iostream>
#include <fstream>
using namespace std;
ifstream F("fact.in");
ofstream G("fact.out");
void var1()
{
int m,n,a,b;
m=n;
b=0;
while (n!=0)
{
b++;
n /= 5; // n = n / 5
}
n = m;
int pw = 1, tot = 0;
for (int i=1;i<=b;++i)
{
pw *= 5;
tot = tot + n / pw;
}
cout<<tot<<'\n';
}
int zerouri(int n)
{
int tot = 0, pw = 5;
while ( pw <= n )
{
tot += n/pw;
pw *= 5;
}
return tot;
}
int n;
int main()
{
F>>n;
int a = 1;
while ( zerouri(a) < n )
++a;
G<<a<<'\n';
return 0;
}