我需要用奇数填充一个二维数组。
我希望它看起来像这样
13579
13579
13579
13579
这是我目前的翻译内容:
这是我目前为止的进展:
public static void twoDArray(){
//https://dev59.com/3mXWa4cB1Zd3GeqPNoJo
int twoDimention[][] = new int[5][3];
for(int i=0; i<twoDimention.length; i++){
for(int j=0; j<twoDimention[i].length; j++){
twoDimention[i][j] = 2*i + 1;
System.out.printf("%d5", twoDimention[i][j]);
}
System.out.println();
}
它将打印:
1515151515
3535353535
5555555555
7575757575
9595959595
有人可以帮忙让这个工作起来吗?