SHARE
TWEET

sadsad

Mixilino Apr 19th, 2019 109 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.     int M[3][4] = { 1,2,3,4,5,6,7,8,9,10,11,12 };
  5.     int B[2][3];
  6.     int curr1 = 0, curr2 = 0, n = 3, m = 4, r = 1, k = 1;
  7.     for (int i = 0; i < n; i++)
  8.     {
  9.         if (i != r) {
  10.             for (int j = 0; j < m; j++)
  11.             {
  12.                 if (k != j) {
  13.                     B[curr1][curr2] = M[i][j];
  14.                     curr2++;
  15.                 }
  16.             }
  17.             curr1++;
  18.             curr2 = 0;
  19.         }
  20.        
  21.     }
  22.     for (int i = 0; i < 3; i++)
  23.     {
  24.         for (int j = 0; j < 4; j++)
  25.         {
  26.             printf("%d\t", M[i][j]);
  27.         }
  28.         printf("\n");
  29.     }
  30.     printf("\n\nPosle promena\n");
  31.     for (int i = 0; i < 2; i++)
  32.     {
  33.         for (int j = 0; j < 3; j++)
  34.         {
  35.             printf("%d\t", B[i][j]);
  36.         }
  37.         printf("\n");
  38.     }
  39. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top