my code works for printing 3 by 3 star pattern. But when I want to replace it with my desired one, it doesn't work.
/*
* * *
* * *
* * * /*
/* The pattern I want to make is:
+--+--+--+
| | | |
+--+--+--+
| | | |
+--+--+--+
| | | |
+--+--+--+ */
public class HelloWorld
{
public static void main(String[] args)
{
for( int i = 0; i<=2; i++){
for(int j =0; j<=2; j++){
System.out.print("*--*\n| |");
}
System.out.println();
}
}
}
Aucun commentaire:
Enregistrer un commentaire