#include <stdio.h>
#include <stdlib.h>
int main(void) {
int k, l, i, j, min, max,intervalo;
//cria matriz do tamanho informado pelo usuario
printf("Informe o tamanho da matriz: "); float mat[k][l];
//preenche a matriz em um intervalo informado pelo usuario
printf("Defina o intervalo: "); scanf("%i%i", &min
, &max
); while (max < min) {
printf("Intervalo invalido. Digite novos valores: "); scanf("%i%i", &min
, &max
); }
intervalo = max - min;
printf("Intervalo: %i \n", intervalo
);
for (i = 0; i < k; i++) {
for (j = 0; j < l; j++) {
mat
[i
][j
] = rand()%intervalo
+ min
; }
}
//mostra a matriz
for (i = 0; i < k; i++) {
for (j = 0; j < l; j++) {
}
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KIAppbnQgbWFpbih2b2lkKSB7CglpbnQgaywgbCwgaSwgaiwgbWluLCBtYXgsaW50ZXJ2YWxvOwoJCgkvL2NyaWEgbWF0cml6IGRvIHRhbWFuaG8gaW5mb3JtYWRvIHBlbG8gdXN1YXJpbwoJcHJpbnRmKCJJbmZvcm1lIG8gdGFtYW5obyBkYSBtYXRyaXo6ICIpOwoJc2NhbmYoIiVpJWkiLCAmaywgJmwpOwoJZmxvYXQgbWF0W2tdW2xdOwogCgkvL3ByZWVuY2hlIGEgbWF0cml6IGVtIHVtIGludGVydmFsbyBpbmZvcm1hZG8gcGVsbyB1c3VhcmlvCglwcmludGYoIkRlZmluYSBvIGludGVydmFsbzogIik7CglzY2FuZigiJWklaSIsICZtaW4sICZtYXgpOwoJd2hpbGUgKG1heCA8IG1pbikgewoJCXByaW50ZigiSW50ZXJ2YWxvIGludmFsaWRvLiBEaWdpdGUgbm92b3MgdmFsb3JlczogIik7CgkJc2NhbmYoIiVpJWkiLCAmbWluLCAmbWF4KTsKCX0KCQoJaW50ZXJ2YWxvID0gbWF4IC0gbWluOwoJcHJpbnRmKCJJbnRlcnZhbG86ICVpIFxuIiwgaW50ZXJ2YWxvKTsKIAoJZm9yIChpID0gMD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