public class HelloWorld {
public static void main(String []args)
{
int[] arr = {5,10,23,6,9};
for(int i = 0; i<arr.length; i++)
{
for( int j = 0; j< arr[i]; j++)
{
System.out.print("*");
}
System.out.println();
}
}
}
That is my code, however, it prints the city horizontally, while I'd like it to print vertically. Any thoughts.
Aucun commentaire:
Enregistrer un commentaire