vendredi 27 février 2015

how do i remove the space at at the end of the column header?



//i want to know how to remove the space at the end of the column header?


public class Boolean {



public static void main(String[] args) {
boolean[][] a = {{true, false, false, false, false},

{true, true, false, false, false},
{true, true, true, false, false},
{true, true, true, true, false},
{true, true, true, true, true}};

for ( int j = 0; j < a.length; j++ ) {
System.out.print( j + 1 + " " );
}
System.out.println();
for ( int i = 0; i < a.length; i++ ) {
for ( int j = 0; j < a[i].length; j++ ) {
System.out.print( ( a[i][j] == true ) ? "* " : " " );
}
System.out.print( i + 1 + "\n" );
}
}



Aucun commentaire:

Enregistrer un commentaire