Cod sursa(job #1417081)
| Utilizator | Data | 9 aprilie 2015 16:12:26 | |
|---|---|---|---|
| Problema | Factorial | Scor | 5 |
| Compilator | c | Status | done |
| Runda | Arhiva de probleme | Marime | 0.45 kb |
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n = 5, p, i, c;
freopen("fact.in", "r", stdin);
freopen("fact.out", "w", stdout);
scanf("%d", &p);
for (i = 1; i < p; i++)
{
n += 5;
if (n % 25 == 0)
{
i++;
c = i;
}
}
if (c == p)
{
printf("-1 ");
}
else
{
printf("%d ", n);
}
return 0;
}
