Questions tagged as 'matriz'

1
answer

How to transform a diagonal elements list from a python array [closed]

I have the following array, for example: 1 2 3 4 5 6 7 8 9 3 8 9 matriz = 4 5 2 3 4 4 2 3 4 5 3 6 4 5 3 4 5 6 I would like to get only the elements of the main diagonal, such as: A = [1, 8, 2, 5, 5]   ...
asked by 07.12.2017 / 13:08
1
answer

Go through array 4x4 with for, I did not understand

I did not understand this code: #include <stdio.h> #include <stdlib.h> int main() { int i, j; for(i=1; i<5; i++) { for(j=1; j<5; j++) { if(i==j) printf("1 "); else...
asked by 20.07.2015 / 01:21
1
answer

Set of 3 Java ports

I have to do an exercise in Java that consists of creating an array [3] [3] where each line would be a phase of the game. The user must guess which door the prize is on. For this I need to do a random on each line assigning the value 1 for the...
asked by 17.04.2015 / 11:45
3
answers

Find index of a value in an array

I want to look up the index of an array by a value: List<string> list = new List<string>() { "Leão", "Guepardo", "Elefante" }; String[] array = new String[3] { "Leão", "Guepardo", "Elefante" }; For example, I want to look up the...
asked by 09.08.2018 / 17:14
1
answer

Transform vectors into an array

I have several signals, where s1, s2 to sn, are vectors of size n, I would like to join them in an array to look like this: matriz = ( [s1] [s2] ... [sn] ) So that I can access an element at any point, for e...
asked by 11.05.2018 / 21:12
2
answers

Arrays in Python - Concatenate

Hello, I have two arrays and I would like to concatenate them, ie, put a matrix A and B on the other side of the matrix, in the case of forming a 3x6 matrix, but using a loop ("for" command) for this. can you help me? Thank you. matriz_a = [...
asked by 01.06.2018 / 18:23
1
answer

Problem with float and array

I have to add the values that have two or more decimal places but when I put it on exp: "1.0", it fills the whole row automatically and jumps to the next, I reviewed and I do not know why it is giving error so thank you if you can help. #inclu...
asked by 29.09.2016 / 23:06
1
answer

How to delete items in an array? (Python 3)

I need to build a program where the user might delete events from event programming, but the problem here is that when it deletes another event, I say, after having deleted the first one (a sublist / number indicated there next to the name), the...
asked by 25.11.2018 / 20:06
1
answer

Read char array from a binary file

Function that writes and reads the binary file: int FUNCAO_QUE_GRAVA_BIN (char filename[],int partida1,char resultado1) { typedef struct { int partida; char jogvelha[3][3]; char resultad...
asked by 27.11.2018 / 12:20
1
answer

Array of strings and pointers

Read the comments in the code #include <stdio.h> int main(void) { char *nomes[2][2]; //Eu não entendo porque se eu tirar esse ponteiro * o codigo dá erro nomes[0][0]="Misael"; nomes[0][1]="Zaes"; nomes[1][0]="Joao"; nomes[...
asked by 11.08.2018 / 20:06