Tue Jul 24, 2012 4:07 pm
int[][] arrayNotBalanced = new int[10][];
for (int i = 0; i < arrayNotBalanced.length; i++) {
arrayNotBalanced[i] = new int[i + 1];
}
// printing the rectangle array
for (int i = 0;i < arrayNotBalanced.length; i++) {
for (int j = 0; j < arrayNotBalanced[i].length; j++) {
System.out.print(" " + arrayNotBalanced[i][j]);
}
System.out.println("");
}
0
0 0
0 0 0
0 0 0 0
0 0 0 0 0
0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.