Advertisement
Josif_tepe

Untitled

Jun 10th, 2024
344
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <ctype.h>
  4. #include <math.h>
  5.  
  6. int funkcija(int *niza, int n) {
  7.     int ok = 1;
  8.     for(int i = 0; i < n - 1; i++) {
  9.         if(niza[i] >= niza[i + 1]) {
  10.             ok = 0;
  11.         }
  12.     }
  13.     return ok;
  14. }
  15. int main(int argc, char * argv[]) {
  16.     int n;
  17.     scanf("%d", &n);
  18.  
  19.     int niza[n];
  20.     for(int i = 0; i < n; i++) {
  21.         scanf("%d", &niza[i]);
  22.     }
  23.  
  24.     int rezult = funkcija(niza, n);
  25.     printf("%d\n", rezult);
  26.    
  27.    
  28.    
  29. }
  30.  
  31.  
  32. /*
  33. 5
  34. 1 -2 3 -4 5
  35.  
  36. **/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement