#include <stdio.h>
#include <stdlib.h>
void matriz_ponteiro(int mtr[3][4]) {
int lin, col;
for (lin = 0; lin < 3; lin++) {
for (col = 0; col < 4; col++) {
printf("\t%d", mtr
[lin
][col
]); }
}
}
int main() {
int mtr[3][4];
int lin, col, cont;
cont = 0;
// armazenar o valor de cont em cada posição da matriz
for (lin = 0; lin < 3; lin++) {
for (col = 0; col < 4; col++) {
mtr[lin][col]= cont++;
}
}
matriz_ponteiro(mtr);
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCnZvaWQgbWF0cml6X3BvbnRlaXJvKGludCBtdHJbM11bNF0pIHsKICAgIGludCBsaW4sIGNvbDsKICAgIGZvciAobGluID0gMDsgbGluIDwgMzsgbGluKyspIHsKICAgICAgICBwcmludGYoIlxuIik7CiAgICAgICAgZm9yIChjb2wgPSAwOyBjb2wgPCA0OyBjb2wrKykgewogICAgICAgICAgICBwcmludGYoIlx0JWQiLCBtdHJbbGluXVtjb2xdKTsKICAgICAgICB9CiAgICB9Cn0KCmludCBtYWluKCkgewogICAgaW50IG10clszXVs0XTsKICAgIGludCBsaW4sIGNvbCwgY29udDsKICAgIGNvbnQgPSAwOwogICAgLy8gYXJtYXplbmFyIG8gdmFsb3IgZGUgY29udCBlbSBjYWRhIHBvc2nDp8OjbyBkYSBtYXRyaXoKICAgIGZvciAobGluID0gMDsgbGluIDwgMzsgbGluKyspIHsKICAgICAgICBmb3IgKGNvbCA9IDA7IGNvbCA8IDQ7IGNvbCsrKSB7CiAgICAgICAgICAgIG10cltsaW5dW2NvbF09IGNvbnQrKzsKICAgICAgICB9CgogICAgfQogICAgbWF0cml6X3BvbnRlaXJvKG10cik7Cn0=