Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void)
- {
- int n, i, pred, cislo, je = 1;
- scanf("%d", &n);
- if (n >= 0 && n <= 10)
- {
- for (i = 0; i < n; i++)
- {
- scanf("\n%d",&cislo);
- if (i == 0)
- pred = cislo;
- else
- if ((cislo > (2*pred)) || (cislo < (pred/2)))
- je = 0;
- }
- if (je == 0)
- printf("Postupnost je nespravna\n");
- else
- printf("Postupnost je spravna\n");
- }
- else
- return 1;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement