Questions tagged as 'matriz'

3
answers

Can I store values without using static vectors?

I need to create a sparse array of type dynamic cross-list and my cells are of type: typedef struct CELULA{ int linha; int coluna; double valor; }CELULA; However, every time I create a new cell in a function, I do not know how...
asked by 05.11.2017 / 12:40
1
answer

Replace array value (R)

I need to replace the value that appears on the main diagonal of my matrix with another, how to proceed?     
asked by 30.06.2017 / 17:01
1
answer

Output from the highest value of the array going out incorrectly

The code does not print the highest value of the array entered by the user #include<stdio.h> #include<locale.h> int main(void){ setlocale(LC_ALL, ""); int n, m, o=0, posic, posic1; int matriz[n][m]; int lin, col,...
asked by 10.06.2016 / 19:38
1
answer

Array initialization with empty list "{}" in C ++

From what I've seen, it's possible to initialize a vector with the empty list, in C ++, but not in C, so that all vector elements are 0: int meuVetor[10] = {}; // Todos os elementos 0, em C++ What I learned in this answer from SOEn. Is...
asked by 24.03.2016 / 22:40
1
answer

Struct and matrix, how to relate?

I'm making a code for a college job and a question has arisen about how to assign values to an array of type struct . struct posicao { int x; int y; }; struct posicao inimigo_val[5][15] = { {{0,-1},{0,-1},{0,-1},{0,-1},{0,-1},{0,-1},{0,...
asked by 10.07.2018 / 19:13
1
answer

Use "-" or "." in a linked list?

Good afternoon, doing a hash table without collisions, I created the struct list, however when compiling the code it does not accept that I use the -> prox from my struct, it asks me to use .prox. But if prox is a pointer I should not use struct...
asked by 11.07.2018 / 20:42
1
answer

Counting sequence of numbers recursively in a matrix C

So, I have the following problem:    I need to count how many descending sequences of numbers exist in an array in a recursive way, but only a sequence is considered if it is complete to the number 1. Ex: The user informs the value that he wa...
asked by 06.07.2018 / 04:42
2
answers

Count of elements in an array, storing information in another

Hello, I'm a beginner in python and I'm doing an exercise that consists of reading all the numbers in an array and adding in another array the numbers in the previous one and how many times they appear. Consequently, matrix 2 will have two lines,...
asked by 05.09.2018 / 16:59
2
answers

Storage of the sum of matrices in vector

This function that I created needs to calculate the sum of each column of the array and store it in a vector position. However, it is not giving the desired result, I think it can be within the third% of%. Can anyone help me with regard to...
asked by 18.06.2018 / 20:19
1
answer

Multiplication of arrays and store in another array?

Be a function that receives three arrays of integer values A, B, and C, and two integers n and m representing the number of rows and columns of these arrays. This function must compute the multiplication of the matrices A and B and...
asked by 19.06.2018 / 20:54