锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产中文字幕一区二区三区,欧美日韩一区二区三区在线电影,国内国产精品久久http://www.aygfsteel.com/BK-JAVA/archive/2007/02/25/100489.html#100504鍠滄潵涔愬搱鍝?/dc:creator>鍠滄潵涔愬搱鍝?/author>Sat, 24 Feb 2007 16:38:00 GMThttp://www.aygfsteel.com/BK-JAVA/archive/2007/02/25/100489.html#100504
public static void main(String[] args) {
int[][] triarray = new int[10][];
int i = 0, j = 0;
for (int[] triarray2 : triarray) {
triarray2 = new int[++i];
}

for (int[] triarray2 : triarray) {
System.out.println(triarray2);
}
}



]]>
re: 涓轟粈涔堣繖孌電▼搴忕紪璇戞垚鍔燂紝浣嗚繍琛屾姏鍑哄紓甯革紵http://www.aygfsteel.com/BK-JAVA/archive/2007/02/25/100489.html#100502JIM.WUJIM.WUSat, 24 Feb 2007 16:15:00 GMThttp://www.aygfsteel.com/BK-JAVA/archive/2007/02/25/100489.html#100502鍛靛懙銆傘傘傘傝阿璋紒錛?
閭d箞涓嬮潰鐨勭▼搴忛棶棰樺張鍦ㄥ摢閲屽憿錛燂紵
public class trigon{
public static void main(String[] args){
int[][] triarray=new int[10][];
int i=0,j=0;
for(int[] triarray2:triarray){
triarray2=new int[++i];
}

for(int[] triarray2:triarray){
for(int tri:triarray2){
triarray2[j++]=j+1;
System.out.println(triarray2+"");
}
System.out.println("");
}
}
}

JIM.WU 2007-02-25 00:15 鍙戣〃璇勮
]]>
re: 涓轟粈涔堣繖孌電▼搴忕紪璇戞垚鍔燂紝浣嗚繍琛屾姏鍑哄紓甯革紵http://www.aygfsteel.com/BK-JAVA/archive/2007/02/25/100489.html#100501鍠滄潵涔愬搱鍝?/dc:creator>鍠滄潵涔愬搱鍝?/author>Sat, 24 Feb 2007 16:02:00 GMThttp://www.aygfsteel.com/BK-JAVA/archive/2007/02/25/100489.html#100501
鐢ㄤ笅闈㈢殑浠g爜灝辮浜嗭紝鎴戞兂涓嶄細(xì)姣擟瑕佸鏉傘?br>
public static void main(String[] args) {
int[][] triarray = new int[10][];
for (int i = 0; i < triarray.length; i++) {
triarray[i] = new int[i + 1];
}
for (int i = 0, k = 1; i < triarray.length; i++) {
for (int j = 0; j < triarray[i].length; j++) {
triarray[i][j] = k++;
}
}
for (int i = 0; i < triarray.length; i++) {
for (int j = 0; j < triarray[i].length; j++) {
System.out.printf("%2d ", triarray[i][j]);
}
System.out.println();
}
}

]]>
re: 涓轟粈涔堣繖孌電▼搴忕紪璇戞垚鍔燂紝浣嗚繍琛屾姏鍑哄紓甯革紵http://www.aygfsteel.com/BK-JAVA/archive/2007/02/24/100489.html#100500JIM.WUJIM.WUSat, 24 Feb 2007 15:51:00 GMThttp://www.aygfsteel.com/BK-JAVA/archive/2007/02/24/100489.html#100500鍛靛懙銆傘傘傘傝阿璋㈠暒錛屼笉榪嘕DK6.0鏄粯璁ゅ垵濮嬪寲鐨勫惂錛屾垜璇曚簡灝?+i錛屾敼涓篿+1闂瑙e喅錛屼笉榪囨槸涓涓棤闄愬驚鐜殑緇撴灉銆傛垜鏈潵鎯寵涓嬮潰鐨勭粨鏋滐紝鍦–閲岄潰鍋氬緢瀹規(guī)槗錛屽湪JAVA閲岄潰涓嶇煡閬撴庝箞寮勩?
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
...........................

JIM.WU 2007-02-24 23:51 鍙戣〃璇勮
]]>
re: 涓轟粈涔堣繖孌電▼搴忕紪璇戞垚鍔燂紝浣嗚繍琛屾姏鍑哄紓甯革紵http://www.aygfsteel.com/BK-JAVA/archive/2007/02/24/100489.html#100493鍠滄潵涔愬搱鍝?/dc:creator>鍠滄潵涔愬搱鍝?/author>Sat, 24 Feb 2007 15:20:00 GMThttp://www.aygfsteel.com/BK-JAVA/archive/2007/02/24/100489.html#100493
public class trigon2{
public static void main(String[] args){
int[][] triarray=new int[10][];
for(int i=0;i<triarray.length;i++){
triarray[i]=new int[++i];
.....

鎶婅繖閲宼riarray[i]=new int[++i];鏀規(guī)垚triarray[i]=new int[i+1];


浣嗘槸榪欐槸涓棤闄愬驚鐜紝鍥犱負(fù)
for(int i=0;i<triarray.length;i++){
for(int j=0;j<triarray[i].length;j++){
j=0;
triarray[i][j]=++k;
System.out.println(triarray[i][j]);
}
}
鍦ㄥ唴寰幆浣犳瘡嬈″張鎶妀=0, j<triarray[i].length褰撶劧涓鐩存槸true浜嗐?br>
鑷充簬浣犵湅鍒扮殑
//Exception in thread "main" java.lang.NullPointerException
// at trigon2.main(trigon2.java:9)
寮傚父錛屾槸鍥犱負(fù)鍦ㄧ涓涓猣or寰幆閲岋紝浣犲彧鍒濆鍖栦簡triarray[0],triarray[2],...
triarray[1],triarray[3]閮借繕娌℃湁琚垵濮嬪寲錛屽綋鐒朵細(xì)鏈塏ullPointerException銆?br>




]]>
主站蜘蛛池模板: 游戏| 江陵县| 金门县| 湾仔区| 靖州| 丁青县| 东丰县| 琼海市| 托克逊县| 新蔡县| 开封市| 璧山县| 云浮市| 凌云县| 邵阳县| 安化县| 大庆市| 五台县| 澎湖县| 鹤庆县| 南澳县| 凤城市| 沙雅县| 比如县| 东至县| 桑日县| 徐州市| 尖扎县| 阳西县| 娄烦县| 乐业县| 巴楚县| 抚远县| 郴州市| 景泰县| 开封市| 西峡县| 大邑县| 平果县| 康马县| 留坝县|