Questions tagged as 'matriz'

2
answers

How to omit char array size in function?

I came up with a question now, I have a function implemented this way: mostrarMensagem(char msg[10]) { //aqui faço algo com a variável "msg". } But I do not know the size that I will receive as the actual parameter, if it is greater than 10...
asked by 29.06.2017 / 06:17
1
answer

C - Is it possible to insert an array into a structure? [closed]

A question that came to me days ago was whether it is possible to insert a matrix into a structure, I think so, but in the process of deciding to clarify it. EXAMPLE typedef struct matrizexemplo { int matriz[2][2]; }     
asked by 07.12.2016 / 00:51
1
answer

Java array: no value

I'm having a small problem regarding an array that I am trying to develop to get coordinates inside a JFrame and pass them to position the buttons correctly. Here is the code: public class Coordenadas { //coordenadas int posic...
asked by 19.11.2016 / 04:50
1
answer

How to create a sub array from an array in Python?

I was able to generate an array via Python and through this generated array I had to generate a 3x3 array. But I do not know how to do this, I was researching and I know that Python itself has a resource for this, but I do not think so. Examp...
asked by 11.02.2017 / 02:10
2
answers

How to check the 4 vertical and horizontal elements in an array based on the current position?

Let's suppose I have an array like this: $matrix = [[0, 1, 1, 0], [1, 1, 1, 0], [1, 0, 0, 0]]; Imagine that you are looping and capturing the position of this array as in the example below, y lines with my arrays and...
asked by 21.09.2015 / 21:16
1
answer

How to use for each in arrays array?

Having the arrays array: int matriz[][] = new int[1][1] How do I use the for each (for (int count: array)) to traverse its rows and columns?     
asked by 20.05.2015 / 05:19
3
answers

Comparing matrices of different sizes in R

I have the following situation: all_sec = Matrix of all possible assets in a portfolio all_sec <- matrix(c("SEC1","SEC2","SEC3","SEC4","SEC5"),ncol=1) portfolio < - composition of an asset portfolio (column 2 is equal to the weight...
asked by 15.07.2014 / 17:52
2
answers

Change the value of a number in an array without knowing the position (index) in Python

Hello, how do I change the value of a number in an array when I do not know what its index and can there be more than one value to change? For example, if I have the array: [[4,5,3,15,4], [20,17,3,4,56], [5,6,2,90,32], [18,7,1,8,13], [0,20...
asked by 01.04.2018 / 07:49
2
answers

How to multiply the number of lists by an integer?

If I have an integer in input and a list in input, is it possible to multiply the integer by the list? M = int(input()) C = (eval('[' + input() + ']')) That is, to have '' M '' lists according to the integer that I put in M, hence I will b...
asked by 20.05.2018 / 21:08
1
answer

Graphs - return a pointer to the adjacency array

I'm implementing a Graph Theory work that deals with the Flood-It game which is a flood problem in Graphs. I'm fine at the beginning and implemented the graph structure yet. Its structure is: typedef struct { int V; int A; int...
asked by 18.05.2018 / 22:49