Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Project: Drawing_With_Loops - created by borkins on 2017-04-01.
- */
- import java.util.Scanner;
- public class _08_Sunglasses
- {
- public static void main(String[] args)
- {
- Scanner console = new Scanner(System.in);
- int n = Integer.parseInt(console.nextLine());
- String frame = new String(new char[2 * n]).replace("\0","*");
- String space = new String(new char[n]).replace("\0", " ");
- String glass = "*" + new String(new char[2 * n - 2]).replace("\0", "/") + "*";
- String bridge = new String(new char[n]).replace("\0", "|");
- for (int row = 1; row <= n; row++)
- {
- if (row == 1 || row == n) {
- System.out.println(frame + space + frame);
- continue;
- }
- if (row == n - n / 2) {
- System.out.println(glass + bridge + glass);
- } else {
- System.out.println(glass + space + glass);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment