Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package DrawingWithLoops;
- import java.util.Scanner;
- /**
- * Created by Minito on 20.4.2017 г..
- */
- public class Demo_Fox {
- public static void main(String[] args) {
- Scanner console = new Scanner(System.in);
- int n = Integer.parseInt(console.nextLine());
- int dashCount = (n * 2) -1;
- for (int i = 0; i < n ; i++) {
- String star = newString("*", i + 1);
- String dash = newString("-",dashCount - 2 * i);
- System.out.println(star + "\\" + dash +"/"+star);
- }
- for (int i = 0; i < n / 3 ; i++) {
- String stars = newString("*", n / 2 + i);
- String starsIn = newString("*",n - 2 * i);
- System.out.println("|" + stars + "\\" +starsIn + "/" + stars + "|");
- }
- for (int i = 0; i < n ; i++) {
- String star = newString("*", dashCount - 2 * i);
- String dash = newString("-",i + 1);
- System.out.println(dash + "\\" + star +"/"+dash);
- }
- }public static String newString(String text, int repeatCount) {
- String a = "";
- for (int i = 0; i < repeatCount; i++) {
- a += text;
- }
- return a;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement