Advertisement
Ronka

Untitled

Feb 28th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. /**
  4. * Created by ValioHP on 26.2.2017 г..
  5. */
  6. public class fox {
  7. public static void main(String[] args) {
  8. Scanner console = new Scanner(System.in);
  9. int n = Integer.parseInt(console.nextLine());
  10.  
  11. for (int i = 0; i < n; i++) {
  12.  
  13. System.out.print(repeat("*", i+1));
  14. System.out.print("\\" + repeat("-", 2*n - 1 - 2*i));
  15. System.out.println("/" + repeat("*", i+1));
  16.  
  17. }
  18.  
  19. for (int i = 0; i < 3; i++) {
  20. System.out.println("|"+ repeat("*", n/2 +i)+"\\"+ repeat("*",n-2*i) + "/" +repeat("*", n/2+i) + "|");
  21. //System.out.print(repeat("*", n));
  22. }
  23.  
  24. for (int i = 0; i < n; i++) {
  25. System.out.print(repeat("-", i+1));
  26. System.out.print("\\" + repeat("*", 2*n - 1 - 2*i) + "/");
  27. System.out.println(repeat("-", i+1));
  28. //System.out.println(dash + "\\" + star + "/" + dash);
  29. }
  30. // 2*n + 3 - 11/2 i
  31. }
  32.  
  33. public static String repeat (String text, int n) {
  34. String output = "";
  35. for (int i = 0; i < n; i++) {
  36. output += text;
  37. }
  38. return output;
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement