Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1.  
  2. public class Lesson72 {
  3.  
  4. public static void main(String[] args) {
  5. // TODO Auto-generated method stub
  6. //output 3 "*"
  7. // 0 1 1 times
  8. // 0 100 100 times
  9. // for (int i=0; i<3; i++) {
  10. // System.out.print("*");
  11. // }
  12.  
  13. //Task 1:
  14. for (int j=0; j<3; j++) {
  15. System.out.print("*");
  16. for (int i=0; i<2; i++) {
  17. System.out.print(" ");
  18. }
  19. System.out.print("*");
  20. for (int i=0; i<2; i++) {
  21. System.out.print(" ");
  22. }
  23. System.out.print("*");
  24. System.out.println();
  25. }
  26. //output one "*"
  27. //output 2 spaces
  28. //output one "*"
  29. //output 2 spaces
  30. //output one "*"
  31.  
  32.  
  33.  
  34. }
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement