初始化2D数组的方法 [英] Methods for initialising 2D arrays
本文介绍了初始化2D数组的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
i刚刚开始学习编程,我实际上我的代码有问题我很高兴如果你帮助我这个
i需要显示座位模式在这样的飞机上
1 ABCD
2ABCD
3ABCD
4ABCD
5ABCD
6ABCD
6ABCD
7ABCD和她是我的治疗
hi
i just start studying programing and i actually i have problem with my code i would be happy if you help me out in this
i need to display the seat pattern in air plane like this
1 ABCD
2ABCD
3ABCD
4ABCD
5ABCD
6ABCD
6ABCD
7ABCD AND HER E IS MY TREYING
展开 | 选择 | Wrap | 行号
推荐答案
只需几点观察:
1)每次你重新初始化整个阵列重新在循环体中;
2)列索引也从零开始;
3)数组初始化可以像这样完成:
Just a few observations:
1) you re-initialize the entire array everytime you''re in the loop body;
2) column indexes also start at zero;
3) array initialization can be done like this:
展开 | 选择 | Wrap | 行号
或者你可以使用两个for循环,例如:
Or you can use two for loops,like:
展开 | 选择 | Wrap | 行号
亲爱的朋友,我想说谢谢你快速回复。
i你已经告诉我了但是我想告诉我如何调用阵列显示我上面提到的因为
我做了什么因为我使用过国际象棋棋盘的例子
所以我可以期待更多的解释
谢谢你
Dear friend i want say thank you for you r fast reply .
i already did you have told me but the i want you tell me how do i call the array to be shown as i mentioned above coz
what i did befor i used an example for chess board
so i may expect more explain
thank you
这篇关于初始化2D数组的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文