#include <stdio.h>
#include <stdlib.h>
#define L 2
#define C 2
int main(int argc, char** argv) {
int matriz[L][C], mat2[L][C];
int i, j, pL = 0, pC = 0, contMaior30 = 0, contIgual30 = 0, contDif30 = 0;
for (i = 0; i < L; i++) {
for (j = 0; j < C; j++) {
scanf("%d", &matriz
[i
][j
]); }
}
//Laço para fazer a verificação dos valores digitados
for (i = 0; i < L; i++) {
for (j = 0; j < C; j++) {
if (matriz[i][j] == 30){
mat2[i][j] = 0;
contIgual30++;
}
else {
contDif30++;
mat2[i][j] = matriz[i][j];
if (matriz[i][j] > 30){
contMaior30++;
}
}
}
}
//Não sei como controlar a impressão de segunda matriz
printf("\nImpressão do segundo vetor: \n"); for (i = 0; i < 2; i++) {
for (j = 0; j < 2; j++) {
if (mat2[i][j] <= 30){
printf("\tM2: %d \n", mat2
[i
][j
]); }
}
}
return (EXIT_SUCCESS);
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2RlZmluZSBMIDIKI2RlZmluZSBDIDIKCmludCBtYWluKGludCBhcmdjLCBjaGFyKiogYXJndikgewogICAgaW50IG1hdHJpeltMXVtDXSwgbWF0MltMXVtDXTsKICAgIGludCBpLCBqLCBwTCA9IDAsIHBDID0gMCwgY29udE1haW9yMzAgPSAwLCBjb250SWd1YWwzMCA9IDAsIGNvbnREaWYzMCA9IDA7CgogICAgZm9yIChpID0gMDsgaSA8IEw7IGkrKykgewogICAgICAgIGZvciAoaiA9IDA7IGogPCBDOyBqKyspIHsKICAgICAgICAgICAgcHJpbnRmKCJNWyVkXVslZF0gPSAiLCBpLCBqKTsKICAgICAgICAgICAgc2NhbmYoIiVkIiwgJm1hdHJpeltpXVtqXSk7CiAgICAgICAgfQogICAgfQoKICAgIC8vTGHDp28gcGFyYSBmYXplciBhIHZlcmlmaWNhw6fDo28gZG9zIHZhbG9yZXMgZGlnaXRhZG9zCiAgICBmb3IgKGkgPSAwOyBpIDwgTDsgaSsrKSB7CiAgICAgICAgZm9yIChqID0gMDsgaiA8IEM7IGorKykgewogICAgICAgICAgICBpZiAobWF0cml6W2ldW2pdID09IDMwKXsKICAgICAgICAgICAgICAgIG1hdDJbaV1bal0gPSAwOwogICAgICAgICAgICAgICAgY29udElndWFsMzArKzsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgIGNvbnREaWYzMCsrOwogICAgICAgICAgICAgICAgbWF0MltpXVtqXSA9IG1hdHJpeltpXVtqXTsKICAgICAgICAgICAgICAgIGlmIChtYXRyaXpbaV1bal0gPiAzMCl7CiAgICAgICAgICAgICAgICAgICAgY29udE1haW9yMzArKzsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KCiAgICAvL07Do28gc2VpIGNvbW8gY29udHJvbGFyIGEgaW1wcmVzc8OjbyBkZSBzZWd1bmRhIG1hdHJpegogICAgcHJpbnRmKCJcbkltcHJlc3PDo28gZG8gc2VndW5kbyB2ZXRvcjogXG4iKTsKICAgIGZvciAoaSA9IDA7IGkgPCAyOyBpKyspIHsKICAgICAgICBmb3IgKGogPSAwOyBqIDwgMjsgaisrKSB7CiAgICAgICAgICAgIGlmIChtYXQyW2ldW2pdIDw9IDMwKXsKICAgICAgICAgICAgICAgIHByaW50ZigiXHRNMjogJWQgXG4iLCBtYXQyW2ldW2pdKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KCiAgICByZXR1cm4gKEVYSVRfU1VDQ0VTUyk7Cn0K