Questions tagged as 'array'

2
answers

Add integers of an array in python

This is a simple question but I have not found any post related to this topic. matriz=[[1,2,3],[4,5,6][7,8,9]] I would like to add all the grids of this matrix to each other (1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9) so that I returned 45 in a new...
asked by 23.05.2018 / 23:43
2
answers

problems reading ajax array

What am I doing wrong? I am making a ajax request that returns me as callback this type of array or object [{"nombre":"Kabul"},{"nombre":"Qandahar"},{"nombre":"Herat"},{"nombre":"Mazar-e-Sharif"},{"nombre":"Otra"}] At the time o...
asked by 01.11.2018 / 01:41
2
answers

C ++ Calculation of separate rows Matrix

This is my code: #include <iostream> using namespace std; int main() { int c, floor, colum; float rent; cout<<"\n\n\t\t\t\t< Sistema de calculo de arriendos >"<<endl<<endl<<endl; cout<&l...
asked by 21.09.2016 / 20:37
3
answers

Add values from a JSON array

I have this JSON array: [{"amount":"500"},{"amount":"750"},{"amount":"250"}] I have tried to add the values it contains with: $.getJSON('http://api.com..../water.php',function(data_water_tot){ console.log(data_water_tot); $.each(data_wat...
asked by 26.05.2017 / 16:42
2
answers

Recover array generated in JSON and sent by POST

I create a array with JSON and send it in an encrypted variable in base64 in a form. I recover it by POST , the decrypted and it remains: [ {"idcliente":"1", "id_comercial":"999999", "preciototal":"698.01", "p...
asked by 27.06.2016 / 19:13
3
answers

Transform php array to an array with objects?

I get the following array, all data are separated by a *, I tried to use explode and implode without results, I think something more complex is needed to solve it using php 5.6 Array ( [0] => [1] => 1 [2]...
asked by 08.08.2018 / 18:19
3
answers

How to Order Vectors in C #?

How can I get my vector ordered from lowest to highest, what happens is that I already have my method that I should do that, only that I have a logic problem, since it marks me error when making my if public void ordeanar() {...
asked by 22.09.2016 / 17:46
2
answers

Sum of all the values of an array in JavaScript

I want to do the following program: Web that asks the user for their notes and calculates the average grade for the term To do this I thought I would store all the notes in an array, display them on the screen and then show the average....
asked by 11.06.2018 / 20:41
3
answers

Multiply matrices in python

This is a question a bit simple but I can not solve it on my own, and I have not found any post related to this topic, my question is this: matriz=[[1,1,1],[1,1,1],[1,1,1]] print(matriz) matriz[0]=matriz[0]*2 print(matriz) What I want to...
asked by 21.05.2018 / 22:37
2
answers

How to sort a two-dimensional array by columns?

I would like to do this, but in PHP : How to sort a matrix two-dimensional by columns in Javascript? array= [ //Columnas: 0 1 2 3 4 /*Filas: 0*/ [9,5,3,2,7], /* 1*/ [7,9,5,4,3], /* 2*/ [8,4,6,0,1] ] array...
asked by 26.01.2018 / 10:14