Advertisement
Josif_tepe

Untitled

Aug 23rd, 2023
875
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.70 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main(int argc, const char * argv[]) {
  4.     int n, m;
  5.     scanf("%d%d", &n, &m);
  6.    
  7.     int mat[n][m];
  8.     for(int i = 0; i < n; i++) {
  9.         for(int j = 0; j < m; j++) {
  10.             scanf("%d", &mat[i][j]);
  11.         }
  12.     }
  13.    
  14.     int najgolem_broj = mat[0][0];
  15.     int najgolem_red = 0;
  16.     int najgolem_kolona = 0;
  17.    
  18.     for(int i = 0; i < n; i++) {
  19.         for(int j = 0; j < m; j++) {
  20.             if(mat[i][j] > najgolem_broj) {
  21.                 najgolem_broj = mat[i][j];
  22.                 najgolem_red = i;
  23.                 najgolem_kolona = j;
  24.             }
  25.         }
  26.     }
  27.     printf("%d\n", najgolem_broj);
  28.     return 0;
  29.    
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement