タイトル : 組み合わせ合計検索 つづき 投稿日 : 2023/08/11(Fri) 06:34 投稿者 : たけし
お世話になります。 組み合わせ合計検索 サンプル 23/02/12 10:52 No.12102 についてです。 Dim 値一覧1 As Integer() = {60, 57, 54, 45, 42, 500, 1000, 60, 25, 57} ↑こちらの部分を 以下のように代入しまして Dim sDATA() As Integer ReDim sDATA(100) Dim cnt As Integer cnt = 0 For i As Integer = 0 To DataGridView1.Rows.Count - 1 sDATA(cnt) = Me.DataGridView1(1, i).Value cnt = cnt + 1 If Me.DataGridView1(6, i).Value <> "" Then Data2 = Me.DataGridView1(6, i).Value For ii As Integer = 0 To Data2 - 2 sDATA(cnt) = Me.DataGridView1(1, i).Value cnt = cnt + 1 Next ii End If Next i 探索(590, sDATA) を実行すると ↓こちらでエラーでます。 If values.Any(Function(v) v <= 0) Then Throw New ArgumentOutOfRangeException("values", "自然数が必要です。") 配列の宣言方法に問題あるのでしょうか? よろしくお願いします。 |