Encode this program that consists of reading 2 matrices of whole numbers, adding the values that do not belong to the diagonal of each matrix and in the end determining if said averages are the same or different.
The fact is that once he give...
import random
n = int(input("Ingrese el numero de fila: \n"))
m = int(input("Ingrese el numero de columna: \n"))
#a = n*m
matriz = []
for i in range(n):
for j in range(m):
matriz[i][j] = random.randint(0, 100)
print(matriz)
I h...
I do not know how to solve this error:
error: Exception in thread "main"
java.lang.ArrayIndexOutOfBoundsException: 0
It takes me to the next class, in the setFilas function, that I use to insert a row into a matrix.
package...
I had doubts about the route of the upper triangular matrix, for me the upper triangular is that of the photo:
for (int i=1; i<=m_-1; i++){
for (int j=i+1; j<= n_;j++){
Could you start at i = 1? Why the stop condition for the f...
When I print this matrix, it should go vertical, as the 1s come out, but I get everything in a straight line. But if after cout << char(254); I put a endl I get spaces between each character and not together.
if (x == 1) {...
Hellos ppl, I come with a curiosity, the code below works well, if I have the following arrays:
int [][] vec1 = {{1,2,3},{4,5,6}};
int [][] vec2 = {{7,8,9},{10,11,12}};
It gives me as a result:
[ 8 10 12 14 16 1...
Good day! I have to make a program where 2 matrices are added from a file, but I have no idea how to put the codes together. The image shows what I am asked for and in the second program at the time of execution, it does not matter what numbers...
I have a file .txt with a lot of information, I want to read it with python but at the same time I read it I need to fill a two-dimensional array taking the word or the data separated by the comma as a position and not each character as a...
I'm starting to program in java, novice in this language, I'm doing a cinema seating assignment program, which I'm doing with a matrix of dimension 6, but when comparing the matrices with a character it performs well but I enter || (or) to compa...
You will see I am doing a program in which you ask for the elements of a matrix and it returns them to me, the point is that when you execute it, you return the last value that you enter repeatedly. Example if I assign a 2x2 matrix it asks me fo...