I have this code:
String[]sweetFlevors ={
"Caramel", "Cinnamon", "Wetermelon", "Backed Beans"};
String[]savoryFlavors={
"Sea Salt", "Potato Chip", "Carrot", "Barbque"};
int[] numberRows = {1, 2, 3, 4};
int[] numberCol = {1 , 2};
for(int col =0; col <numberCol.length; col++){
System.out.println(" " + numberCol[0]+ " " + numberCol[1]);
for(String sweet: sweetFlevors){
for(String savory : savoryFlavors){
for(int row = 0; row < numberRows.length; row++){
System.out.print(numberRows[row]+ ". ");
System.out.println(sweet + " and " + savory);
}
}
}
}
}
}
and my Output is something like this:
1 2
1. Caramel and Sea Salt 2. Caramel and Sea Salt 3. Caramel and Sea Salt 2. Wetermelon and Carrot 3. Backed Beans and Barbque 4. Backed Beans and Barbque 1 2 // How to delete this line? 1. Caramel and Sea Salt 2. Caramel and Sea Salt
I dont know how I can delete the second line column? and why I get it?
thanks you for help me :)
Aucun commentaire:
Enregistrer un commentaire