回答編集履歴
2
質問文のコードの誤りを修正するコード掲載
test
CHANGED
@@ -31,3 +31,59 @@
|
|
31
31
|
results.Add(test2);
|
32
32
|
|
33
33
|
```
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
質問に記載のコード(誤り)
|
38
|
+
|
39
|
+
```ここに言語を入力
|
40
|
+
|
41
|
+
List<List<string>> results = new List<List<string>>();
|
42
|
+
|
43
|
+
for( int i = 0; i < 10; i++)
|
44
|
+
|
45
|
+
{
|
46
|
+
|
47
|
+
List<string> clist = new List<string>();
|
48
|
+
|
49
|
+
for(int j = 0; j < 5; j++)
|
50
|
+
|
51
|
+
{
|
52
|
+
|
53
|
+
clist.Add(i.ToString() + j.ToString());
|
54
|
+
|
55
|
+
}
|
56
|
+
|
57
|
+
list.Add(clist);
|
58
|
+
|
59
|
+
}
|
60
|
+
|
61
|
+
```
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
質問に記載のコード(修正)
|
66
|
+
|
67
|
+
```ここに言語を入力
|
68
|
+
|
69
|
+
List<List<string>> results = new List<List<string>>();
|
70
|
+
|
71
|
+
for( int i = 0; i < 10; i++)
|
72
|
+
|
73
|
+
{
|
74
|
+
|
75
|
+
List<string> clist = new List<string>();
|
76
|
+
|
77
|
+
for(int j = 0; j < 5; j++)
|
78
|
+
|
79
|
+
{
|
80
|
+
|
81
|
+
clist.Add(i.ToString() + j.ToString());
|
82
|
+
|
83
|
+
}
|
84
|
+
|
85
|
+
results.Add(clist);
|
86
|
+
|
87
|
+
}
|
88
|
+
|
89
|
+
```
|
1
追記
test
CHANGED
@@ -5,3 +5,29 @@
|
|
5
5
|
private List<List<string>> results = new List<List<string>>();
|
6
6
|
|
7
7
|
```
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
設定方法の例
|
12
|
+
|
13
|
+
```ここに言語を入力
|
14
|
+
|
15
|
+
var test1 = new List<string>();
|
16
|
+
|
17
|
+
test1.Add("a1");
|
18
|
+
|
19
|
+
test1.Add("a2");
|
20
|
+
|
21
|
+
results.Add(test1);
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
var test2 = new List<string>();
|
26
|
+
|
27
|
+
test2.Add("b1");
|
28
|
+
|
29
|
+
test2.Add("b2");
|
30
|
+
|
31
|
+
results.Add(test2);
|
32
|
+
|
33
|
+
```
|