Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Optimized2 {
- public static void main(String[] args) {
- int size = 9;
- for (int i = 1; i <= size; i++) {
- for (int j = 1; j <= size * 2 - 1; j++) {
- System.out.print((i > 1 && size > i && ((i * 2 - 1 == j) || size * 2 - i * 2 + 1 == j) || j % 2 == 0)
- ? ' ' : '*');
- }
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement