public class ArrayTangga{
public static void main(String[]args){
int [][]sel = new int[4][];
int i,j;
for(i =0;i<sel.length;i++)
sel [i]= new int[i+1];
for(i=0;i<sel.length;i++)
for(j=0;j<sel[i].length;j++)
sel[i][j]= i+j;
//for(i=0;i<sel.length;i++){
//for(j=0; j<sel[i].length;j++)
//System.out.print(sel[i][j]+" ");
System.out.println(" ");//pindah baris
//}
}
}
No comments:
Post a Comment