Cod sursa(job #597732)
Utilizator | Data | 23 iunie 2011 04:02:57 | |
---|---|---|---|
Problema | Factorial | Scor | 5 |
Compilator | c | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <stdio.h>
// nr natural minim pt care N! are P zerouri;
int main()
{
freopen("fact.in", "r", stdin);
freopen("fact.out", "w", stdout);
int long p;
scanf("%ld", &p);
if(p <= 0)
{
printf("-1");
return 0;
}
if(p <= 2)
{
printf("%ld", p*5);
return 0;
}
printf("%ld", (p-1)*5);
return 0;
}