Advertisement
Josif_tepe

Untitled

Dec 26th, 2022
1,388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.99 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <ctype.h>
  5.  
  6. int main(int argc, const char * argv[]) {
  7.     int red, kolona;
  8.     scanf("%d%d", &red, &kolona);
  9.    
  10.     int mat[red][kolona];
  11.     for(int i = 0; i < red; i++) {
  12.         for(int j = 0; j < kolona; j++) {
  13.             scanf("%d", &mat[i][j]);
  14.         }
  15.     }
  16.     for(int i = 0; i < red - 1; i++) {
  17.         int najgolem_broj_vo_red_i = mat[i][0];
  18.         for(int j = 0; j < kolona; j++) {
  19.             if(mat[i][j] > najgolem_broj_vo_red_i) {
  20.                 najgolem_broj_vo_red_i = mat[i][j];
  21.             }
  22.         }
  23.        
  24.         for(int j = 0; j < kolona; j++) {
  25.             if(najgolem_broj_vo_red_i > mat[i + 1][j]) {
  26.                
  27.             }
  28.             else {
  29.                 printf("Ne vazhi vo redot: %d\n", i + 2);
  30.                 return 0;
  31.             }
  32.         }
  33.     }
  34.     printf("DA\n");
  35.     return 0;
  36. }
  37. /*
  38. 5 4
  39.  1 2 10 0
  40.  7 2 3 1
  41.  8 0 5 4
  42.  4 1 0 1
  43.  2 3 0 0
  44.  
  45.  
  46.  **/
  47.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement