# your code goes here
A <- matrix(1:25, 5, 5);
B <- matrix(1:25, 5, 5);
C <- matrix(1:25, 5, 5);
A[1,1] = 0.228; A[1,2] = 0.285; A[1,3] = 0.285; A[1,4] = 0.285; A[1,5] = 0.380;
A[2,1] = 0.228; A[2,2] = 0.285; A[2,3] = 0.570; A[2,4] = 0.380; A[2,5] = 0.228;
A[3,1] = 0.380; A[3,2] = 0.285; A[3,3] = 0.228; A[3,4] = 0.380; A[3,5] = 0.285;
A[4,1] = 0.285; A[4,2] = 0.285; A[4,3] = 0.570; A[4,4] = 0.380; A[4,5] = 0.380;
A[5,1] = 0.380; A[5,2] = 0.228; A[5,3] = 0.285; A[5,4] = 0.285; A[5,5] = 0.380;
B[1,1] = 0.383; B[1,2] = 0.174; B[1,3] = 0.535; B[1,4] = 0.700; B[1,5] = 0.396;
B[2,1] = 0.404; B[2,2] = 0.785; B[2,3] = 0.346; B[2,4] = 0.838; B[2,5] = 0.380;
B[3,1] = 0.591; B[3,2] = 0.554; B[3,3] = 0.260; B[3,4] = 0.229; B[3,5] = 0.361;
B[4,1] = 0.176; B[4,2] = 0.865; B[4,3] = 0.423; B[4,4] = 0.166; B[4,5] = 0.349;
B[5,1] = 0.132; B[5,2] = 0.018; B[5,3] = 0.456; B[5,4] = 0.684 ; B[5,5] = 0.150;
i <- 1;
j <- 1;
#Como eu consigo retornar uma terceira
#Matriz (C) que retorna 1 se o valor na mesma
#posicao da matrix B for menor ou igual do que o da
#matriz(A) e 0 se for maior ?
while(i < 6)
{
j <- 1;
while(j < 6){
C[i,j] <- 1;
if (A[i,j] <= B[i,j]){
C[i,j] <- 0;
}
j <- j + 1;
}
i <- i + 1;
}
C;
#OUTRA SOLUÇÃO BEM PRÁTICA
#D <- ifelse(B <= A, 1, 0);
#D;
IyB5b3VyIGNvZGUgZ29lcyBoZXJlCkEgPC0gbWF0cml4KDE6MjUsIDUsIDUpOwpCIDwtIG1hdHJpeCgxOjI1LCA1LCA1KTsKQyA8LSBtYXRyaXgoM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