Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Diamonds
- {
- public static void main(String[] args)
- {
- for(int x=0; x<5; x++)
- {
- for(int y=0; y<(5-x); y++)
- System.out.println(" ");
- for(int x=0; x<(2*y+1); y++)
- System.out.println("*");
- System.out.println();
- for(int x=1; x<5; x++)
- {
- for(int y=0; y<=(i); y++)
- System.out.print(" ");
- for(int y=0; y<(2*(4-x)+1); y++)
- System.out.print("*");
- System.out.println();
- }
- System.out.println();
- System.out.println();
- System.out.println();
- for(int x=0; x<5; x++)
- {
- for(int y=0; y<=(i); y++)
- System.out.print(" ");
- for(int y=0; y<(2*(4-x)+1); y++)
- System.out.print("*");
- System.out.print();
- }
- for(int x=1; x<5; x++)
- {
- for(int y=0; y<(5-x); y++)
- System.out.print(" ");
- for(int y=0; y<(2*x+1); y++)
- System.out.print("*");
- System.out.print();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement