Questions tagged as 'array'

1
answer

Problem SMPSEQ3 - Fun with Sequences - SPOJ

Good morning. I would like some help to create a code that is accepted by SPOJ. The proposed problem is as follows: "You get an ordered sequence of n integers S = s1, s2, ..., sn, and an ordered sequence of integers m Q = q1, q2, ..., qm. bel...
asked by 07.03.2018 / 15:42
1
answer

How do I insert elements of a first vector into another second vector, in a given position given by the user? and also print the step by step

Entradas - Tam do 1 vetor:5/ Elementos do 1 vetor: 1 2 3 4 5 / Elementos do 2 vetor: 6 7 8 9 10/ Pos a ser inserida: 1 Saida- 6 1 7 8 9 10 / 6 2 1 7 8 9 10 / 6 3 2 1 7 8 9 10 / 6 4 3 2 1 7 8 9 10/ 6 5 4 3 2 1 7 8 9 10 NOTE: The size of the...
asked by 28.02.2018 / 18:06
1
answer

suitable function to access array values

I have a file with a function that takes all the records of a table, as below. window.lerTabelaListas=function() { lista=new Array(); db.transaction(function (tx) { tx.executeSql('SELECT * FROM listas',[],...
asked by 04.03.2018 / 20:25
1
answer

How to structure multidimensional array with json

Good evening !!! I have a json that returns in this format: {rua: "A01", col: "01D", alt: "A"},{rua: "A01", col: "01D", alt: "B"},{rua: "A01", col: "01D", alt: "C"},{rua: "A01", col: "01D", alt: "D"} But I need you to return in this format:...
asked by 28.02.2018 / 01:46
0
answers

Changing value in integer array in an index works in one case, and in another not, why?

privatevoidbtnRodaLabirinto_Click(objectsender,EventArgse){char[,]Lab=newchar[10,10];int[,]Lab2=newint[10,10];intI=0,J=0;RandomNumerosRandomicos=newRandom();//abaixo,setandolabirintocom0e1for(I=0;I<10;I++){for(J=0;J<10;J++){Lab2[I,J]=Nume...
asked by 01.03.2018 / 15:00
1
answer

How to create an array with the same size as another array without copying it?

private void InversaoString(string Texto, int Tamanho) { char[] arrChar = Texto.ToCharArray(); char arrChar2; int indice = 0; for(Tamanho = arrChar.Length-1; Tamanho>=0; Tamanho--) {...
asked by 17.02.2018 / 19:08
0
answers

Problems with data node.js (SQL Data)

I'm having a question regarding receiving SQL data in an array in JavaScript. I have the login information and everything else, regarding the server, but the issue is not the connection, it's saving the data in an array. Example: nameArray [user...
asked by 16.02.2018 / 17:43
0
answers

Read csv file in a 2-d array and edit data in C

I have a csv file and I want to read it in an array and then edit the values of a certain position. Here is an example of my file: id; a; b; c; d; e; f; g; h 1; ; ; ; ; ; ; ; ; 2; ; ; ; ; ; ; ; ; 3; ; ; ; ; ; ; ; ; (...) I declared an ar...
asked by 14.02.2018 / 16:25
0
answers

Map Hash in Ruby

I am loading a hash of an .yml file in the following format: { 'user_id' => 'id', 'profile' => { 'about_me' => 'about', 'phone' => { 'mobile' => 'mobile_phone', 'home' => 'home_phone' }}} I want to output another hash with...
asked by 11.02.2018 / 18:04
1
answer

Copy values from a PHP array

I have two arrays dynamic on my system: Array 1: $nome { [0] => nome1 [1] => nome2 } Array 2: $contagem { [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 }...
asked by 07.02.2018 / 20:39