Advertisement
Josif_tepe

Untitled

Jun 3rd, 2024
324
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.86 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <ctype.h>
  4.  
  5. int main() {
  6.     int n, m;
  7.     scanf("%d%d", &n, &m);
  8.  
  9.     int mat[n][m];
  10.     for(int i = 0; i < n; i++) {
  11.         for(int j = 0; j < m; j++) {
  12.             scanf("%d", &mat[i][j]);
  13.         }
  14.     }
  15.  
  16.     int brojac = 1;
  17.     int rezultat = 0;
  18.  
  19.     for(int i = 0; i < n; i++) {
  20.    
  21.         for(int j = 0; j < m; j++) {
  22.             if(mat[i][j] >= brojac && mat[i][j] < brojac * 10) {
  23.  
  24.             }
  25.             else {
  26.                 printf("mat[%d][%d]=%d\n", i, j, mat[i][j]);
  27.                 rezultat++;
  28.             }
  29.         }
  30.        
  31.         brojac *= 10;
  32.     }
  33.     if(rezultat == 0) {
  34.         printf("Matricata go ispolnuva uslovot\n");
  35.     }
  36.     else {
  37.         printf("%d\n", rezultat);
  38.     }
  39.  
  40.  
  41.    
  42. }
  43. /*
  44. 4 4
  45. 1 2 77 9
  46. 17 22 13 10
  47. 26 255 25 124
  48. 1134 1120 5566 9900
  49.  
  50. **/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement