Guest User

Untitled

a guest
Nov 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1.  
  2. public class Opg5 {
  3. public static void main(String[] args){
  4. String head = new String(" o ******");
  5. String torso = new String("/|\\* ");
  6. String legs = new String("/ \\* ");
  7. String space1 = new String(" ");
  8. String space2 = new String(" ");
  9. String bund = new String("******");
  10.  
  11. int loops = 5;
  12. int pre = loops;
  13. int post = 0;
  14.  
  15. for(int i = 0; i < loops; i++){
  16. pre--;
  17.  
  18. for(int n = 0; n < pre; n++){
  19. System.out.print(space1);
  20. }
  21.  
  22. System.out.print(head);
  23. for(int n = 0; n < post; n++){
  24. System.out.print(space2);
  25. }
  26.  
  27. System.out.println("*");
  28.  
  29. for(int n = 0; n < pre; n++){
  30. System.out.print(space1);
  31. }
  32.  
  33. System.out.print(torso);
  34. for(int n = 0; n < post; n++){
  35. System.out.print(space2);
  36. }
  37.  
  38. System.out.println("*");
  39.  
  40. for(int n = 0; n < pre; n++){
  41. System.out.print(space1);
  42. }
  43.  
  44. System.out.print(legs);
  45. for(int n = 0; n < post; n++){
  46. System.out.print(space2);
  47. }
  48. post++;
  49. System.out.println("*");
  50. }
  51. for(int i = 0; i < loops; i++){
  52. System.out.print(bund);
  53. }
  54. }
  55. }
Add Comment
Please, Sign In to add comment