2个回答
展开全部
你好,提问者:
如果解决了你的问题,请采纳,若有疑问,请追问,谢谢!
package com.gc.action.baiduTest;
public class ErWeiDaYin {
public static void main(String[] args) {
int[][] number = new int[3][3];
show(number);
System.out.println("----------");
int[][] number1 = new int[5][4];
show(number1);
System.out.println("----------");
int[][] number2 = new int[6][2];
show(number2);
}
public static void show(int[][] number){
for(int i = 0; i < number.length; i++){
for(int j = 0; j < number[i].length; j++){
System.out.print("* ");
}
System.out.println();
}
}
}
结果:
* * *
* * *
* * *
----------
* * * *
* * * *
* * * *
* * * *
* * * *
----------
* *
* *
* *
* *
* *
* *
TableDI
2024-07-18 广告
2024-07-18 广告
在上海悉息信息科技有限公司,我们深知Excel在数据处理中的重要作用。在Excel中引用不同工作表(sheet)的数据是常见的操作,这有助于整合和分析跨多个工作表的信息。通过在工作表名称前加上感叹号“!”,您可以轻松地引用其他工作表中的数据...
点击进入详情页
本回答由TableDI提供
2018-11-21 · 百度知道合伙人官方认证企业
关注
展开全部
System.out.print("3x3");
for(int i = 0; i<3; i++){
for(int j = 0; j<3; j++){
System.out.print("*");
}
System.out.println();
}
System.out.print("5x4");
for(int i = 0; i<4; i++){
for(int j = 0; j<5; j++){
System.out.print("*");
}
System.out.println();
}
System.out.print("6x2");
for(int i = 0; i<2; i++){
for(int j = 0; j<5; j++){
System.out.print("*");
}
System.out.println();
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |