how to stored Cj(t) in 2D array
时间: 2024-01-22 11:03:44 浏览: 32
To store Cj(t) in a 2D array, you can create a 2D array with dimensions j and t. Then, you can assign the value of Cj(t) to the corresponding element in the array. For example, if you want to store the value of Cj(t) when j=2 and t=3, you can assign it to the element in the 2nd row and 3rd column of the array. The code to store Cj(t) in a 2D array may look like this:
```
// define the dimensions of the array
int j = 5; // number of rows
int t = 10; // number of columns
// create a 2D array
double[][] array = new double[j][t];
// assign the value of Cj(t) to the corresponding element in the array
int j_index = 2; // row index
int t_index = 3; // column index
double value = 1.23; // value of Cj(t)
array[j_index][t_index] = value;
```
This code creates a 2D array with dimensions 5x10, assigns the value of Cj(t) when j=2 and t=3 to the element in the 2nd row and 3rd column of the array, and stores it in the variable `value`. You can modify the values of `j_index`, `t_index`, and `value` to store different values of Cj(t) in the array.
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)