java array基础编程

[复制链接]
查看11 | 回复1 | 2012-9-8 23:51:04 | 显示全部楼层 |阅读模式
貌似翻译过来是:写一个二维的数组,五行五列,然后这个数组符合的规则是(i,j)位置的值为i-j的绝对值。可以这样写:int a[][]=new int[5][5];for(int i=0;i<5;i++){
for(int j=0;j<5;j++){
a[j]=Math.abs(i-j);
}}for(int i=0;i<5;i++){
for(int j=0;j<5;j++){
System.out.print(a[j]+" ")
}
System.out.pr...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行