Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. public class Diamonds
  2. {
  3. public static void main(String[] args)
  4. {
  5. for(int x=0; x<5; x++)
  6. {
  7. for(int y=0; y<(5-x); y++)
  8. System.out.println(" ");
  9. for(int x=0; x<(2*y+1); y++)
  10. System.out.println("*");
  11. System.out.println();
  12.  
  13. for(int x=1; x<5; x++)
  14. {
  15. for(int y=0; y<=(i); y++)
  16. System.out.print(" ");
  17. for(int y=0; y<(2*(4-x)+1); y++)
  18. System.out.print("*");
  19. System.out.println();
  20. }
  21. System.out.println();
  22. System.out.println();
  23. System.out.println();
  24.  
  25. for(int x=0; x<5; x++)
  26. {
  27. for(int y=0; y<=(i); y++)
  28. System.out.print(" ");
  29. for(int y=0; y<(2*(4-x)+1); y++)
  30. System.out.print("*");
  31. System.out.print();
  32. }
  33.  
  34. for(int x=1; x<5; x++)
  35. {
  36. for(int y=0; y<(5-x); y++)
  37. System.out.print(" ");
  38. for(int y=0; y<(2*x+1); y++)
  39. System.out.print("*");
  40. System.out.print();
  41. }
  42. }
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement