A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

© Lingxin 中级黑马   /  2016-3-24 12:02  /  533 人查看  /  2 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

本帖最后由 Lingxin 于 2016-3-24 12:03 编辑

亲爱滴大神,多多指教!
  1. class HelloWorld {
  2.         public static void main(String[] args) {
  3.                 int[][] arr2 = {{3,5,7,8},{11,44,33,66,88}};
  4.                 for (int i =0;i < arr2.length ;i++ ) {   //遍历二维内含几个一维
  5.                         for (int j =0;j < arr2[i].length ;j++ ) {     //遍历每个一维中的元素
  6.                                 System.out.print(arr2[i][j] +"\t");
  7.                         }
  8.                         System.out.println();       //给一维分别换行
  9.                 }
  10.         }
  11. }
复制代码

2 个回复

倒序浏览
回复 使用道具 举报
两个For循环,,,只能帮你到这里了,因为我还想去其他帖子顶贴0.0
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马