Pagini recente » Cod sursa (job #3255524) | Diferente pentru problema/sudest intre reviziile 2 si 1 | Cod sursa (job #2524386) | Cod sursa (job #1225227) | Cod sursa (job #2257075)
#include <iostream>
#include <fstream>
using namespace std;
ifstream in("fact.in");
ofstream out("fact.out");
int main()
{
int P, n, s, cnt;
in >> P;
for(n = 1; n <=100; n++)
{s = 1;
cnt = 0;
for(int j = 1; j <= n; j++)
{
s = s * j;
}
while(s % 10 == 0)
{
cnt++;
s = s / 10;
}
if( cnt == P)
{
out<<n;
break;
}
}
return 0;
}