arrays

    3熱度

    1回答

    我遇到了React問題。 我有一個數組,我傳遞給this.state。但是我面臨一個問題,我無法訪問數組中的子元素。在我的情況下,我無法訪問this.state.folders [0]。 這裏是我的代碼:提前 // console.log(this.state.folders); [] 0: "Commun" 1: "Privé" 2: "Public"

    1熱度

    1回答

    我想從1個表組唯一的行可能在表2 多行如果我讓這個查詢: SELECT c.`lastname`,a.`city` FROM `customer` c LEFT JOIN `visit` a ON (c.`id` = a.`id`); 我得到的結果是這樣的: lastname |city -------- |---- DOE |Paris DOE |Miami Technica

    0熱度

    1回答

    我使用服務將數組元素添加到數組中,該服務成功添加了元素。我可以看到使用console.log登錄的數據 但我無法訪問該元素。 this.routingService.getNode(startNode).subscribe(node => { node.forEach(node => { this.openSet.push(new MapNode(node.id, node

    -2熱度

    1回答

    用兩個數組填充字典。我不知道如何使用foreach從它獲取數據列表。例如:a 17,l 16 ....請告訴我該怎麼做? string[] words = { "a", "l", "c", "d", "h", "o", "t" }; int[] times = { 17, 16, 1, 02, 11, 19, 21 }; Dictionary<string[], int[]> data= ne

    0熱度

    1回答

    我對C和編程一般都比較陌生,所以我不確定我的問題。每當我運行代碼並打開新的輸出文件時,結構數據僅爲零。這裏是我的代碼....我已經把文本文件的內容放在問題的底部。先謝謝你。 #include <stdio.h> #include <stdlib.h> typedef struct { int id; char description[40]; double mancost; dou

    -1熱度

    1回答

    什麼,我試圖做的很簡單:我想尋找一組變量數組的整條生產線比較,以這樣的: var[2][]=={1,2,3,4,5} //all at the same time 代替 var[2][0]==1 && var[2][1]==2 && var[2][2]==3 && var[2][3]==4 && var[2][4]==5 //one by one 也許 vartwo[4][3...7]==var[

    1熱度

    1回答

    我想構建一個ruby函數來查找所有嵌套數組的通用元素。例如,給出下面的陣列,這就是答案會拿出... [[1, 2, 3], [1, 2], [2]] => [2] [[1, 2, 3], [1, 2, 4]] => [1, 2] 我能做的, arr = [[1, 2, 3], [1, 2], [2]] arr[0] & arr[1] & arr[2] => [2] 但不知道如何

    -2熱度

    2回答

    您好,我的問題是以下內容,即時接收一個2d矩陣,我已經創建了一個名爲City的類,它將保存x和y的位置座標值將以逗號分隔這樣 0,0 0,20 4,3 6,2 7,21 for (int k = 0; k < size; k++){ String valuesStrArr2[] = s.nextLine().split(","); for (int l = 0; l

    1熱度

    2回答

    林新,我嘗試寫一些代碼,它用於計算字符串的字母,空格等。所以,我將數組長度設置爲50.但是,當我稍後運行代碼並輸入超過50個字符時,它仍然可以運行,並且總數可能超過50個,爲什麼?謝謝。 import java.util.Scanner; public class javaexcrises { public static void main(String[] args) {

    0熱度

    1回答

    我有這樣的代碼......對於混亂我一直在這一段時間遺憾: loadAvailabilities() { let promises = []; let promises2 = []; let indexi = 0; //return new Promise((resolve, reject) => { this.appointments = t