基本的に、0.01 刻みで 150 の位置を持つ配列 Tp を定義しました。また、同じ 0.01 刻みで 600 の位置を持つ配列 Dp を定義しました。Tp が最初の列に、Dp が 2 番目の列にあるように、Tp と Dp の配列値のすべての組み合わせを 2 つの列に入れる 1 つの大きな配列 TpDp を書き込もうとしています。TpDp[][] の位置が等しくなるように定義する方法がわかりません。たとえば、(構文的に正しくありません) int TpDp[0][0] = new int [Tp[0]][Dp[0]]
.
これにはあらゆる種類のエラーが含まれている可能性がありますが、これまでのところ、Tp と Dp が既に定義された状態でセットアップされています (A = 150、B = 600、これらはそれぞれ Tp と Dp の位置の数です)。
int [][] TpDp = new int [A*B][A*B]; //declaring new 2-dimensional array TpDp, size needed for combos
int i; //iteration counter for Tp
int j; //iteration counter for Dp
for (i=0; i<=A; i++)
{ //i counting through all positions in Tp until exhausts A column options
for (j=0; j<=B; j++)
{ //j counting through all positions in Dp until exhausts B column options
TpDp[i][j] = Tp[i], Dp[j]; //This is where I'm not sure how do define TpDp[i][j]
}
}