Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     int matrix[3][3] = {{1, 2, 3},
  6.                         {4, 5, 6},
  7.                         {7, 8, 9}};
  8.  
  9.     for (int i = 0; i < 3; i++)
  10.         for (int j = 0; j < 3; j++)
  11.             for (int l = 0; l < 3; l++)
  12.                 for (int c = 0; c < 3; c++)
  13.                     if (i != l && j != c)
  14.                         if (matrix[i][j] == matrix[l][c])
  15.                             printf("Tem numero repetido na linha %d e coluna %d com o valor %d\n", i, j, matrix[i][j]);
  16.  
  17.     getchar();
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement