Advertisement
Josif_tepe

Untitled

Feb 10th, 2022
954
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main(){
  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.             if(mat[i][j] != 0 && mat[i][j] != 1) {
  13.                 printf("Matricata ne e validna\n");
  14.                 return 0;
  15.             }
  16.         }
  17.     }
  18.    
  19.     return 0;
  20. }
  21. /*
  22.  5 4
  23.  1 2 10 0
  24.  7 2 3 1
  25.  8 0 5 4
  26.  4 1 0 1
  27.  2 3 0 0
  28.  
  29.  **/
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement