BlueBear

postupnost.c

Mar 25th, 2014
536
0
Never
3
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5.     int n, i, pred, cislo, je = 1;
  6.  
  7.     scanf("%d", &n);
  8.     if (n >= 0 && n <= 10)
  9.     {
  10.         for (i = 0; i < n; i++)
  11.         {
  12.             scanf("\n%d",&cislo);
  13.             if (i == 0)
  14.                 pred = cislo;
  15.             else
  16.                 if ((cislo > (2*pred)) || (cislo < (pred/2)))
  17.                     je = 0;
  18.         }
  19.         if (je == 0)
  20.             printf("Postupnost je nespravna\n");
  21.         else
  22.             printf("Postupnost je spravna\n");
  23.     }
  24.     else
  25.         return 1;
  26.     return 0;
  27. }
Advertisement
Comments
  • User was banned
  • Syutrsz
    204 days
    # text 0.21 KB | 0 0
    1. Best t33n active cpx link daily updates!
    2.  
    3. Copy and paste the link in a new browser tab and then hit enter!
    4.  
    5. https://crazyporn.@xxx/members/157354/?asgtbndr=1&play=true&spon=adworld&zone=400
    6.  
    7. Remove the @
  • Comment was deleted
Add Comment
Please, Sign In to add comment