Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- / uloha-4-16.c -- Tyzden 4 - Uloha 16
- // Michal Kovacik, 18.10.2013 02:36:23
- #include <stdio.h>
- int main()
- {
- int n, akt, pred, i;
- scanf("%d", &n);
- scanf("%d", &akt);
- pred=akt;
- if (akt>10 || akt<0)
- printf("Postupnost nie je spravna\n");
- else
- for(i=1; i<n; i++)
- {
- scanf("%d", &akt);
- if (!(akt<=2*pred && akt>=0.5*pred))
- break;
- pred=akt;
- }
- printf("Postupnost %s spravna\n", (i==n)? "je":"nie je");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement