Cod sursa(job #369875)

Utilizator bghimisFMI Ghimis Bogdan bghimis Data 29 noiembrie 2009 18:09:40
Problema Factorial Scor 5
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.35 kb
#include <iostream>
int main()
{
freopen("fact.in","r",stdin);
freopen("fact.out","w",stdout);
int a ;
std::cin>>a;
int i = 1, g;
g = 0;
while (g < a) 
{
if (i != 0 && i % 25 == 0)
{
g = g + 2;
goto label;
}
if (i != 0 && i % 125 == 0)
{
g = g + 3;
goto label;
}
if (i % 5 == 0)
g = g + 1;
label:
i++;
}
std::cout<<i-1;
return 0;
}