Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // http://judge.softuni.bg/Contests/2/CSharp-Basics-Exam-10-April-2014-Morning
- import java.util.Scanner;
- public class Sunglasses {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- int n = input.nextInt();
- System.out.print(CreateSymbols(n * 2, '*'));
- System.out.print(CreateSymbols(n, ' '));
- System.out.println(CreateSymbols(n * 2, '*'));
- for (int i = 0; i < (n / 2) - 1; i++) {
- System.out.print('*');
- System.out.print(CreateSymbols((n * 2) - 2, '/'));
- System.out.print('*');
- System.out.print(CreateSymbols(n, ' '));
- System.out.print('*');
- System.out.print(CreateSymbols((n * 2) - 2, '/'));
- System.out.println('*');
- }
- System.out.print('*');
- System.out.print(CreateSymbols((n * 2) - 2, '/'));
- System.out.print('*');
- System.out.print(CreateSymbols(n, '|'));
- System.out.print('*');
- System.out.print(CreateSymbols((n * 2) - 2, '/'));
- System.out.println('*');
- for (int i = 0; i < (n / 2) - 1; i++) {
- System.out.print('*');
- System.out.print(CreateSymbols((n * 2) - 2, '/'));
- System.out.print('*');
- System.out.print(CreateSymbols(n, ' '));
- System.out.print('*');
- System.out.print(CreateSymbols((n * 2) - 2, '/'));
- System.out.println('*');
- }
- System.out.print(CreateSymbols(n * 2, '*'));
- System.out.print(CreateSymbols(n, ' '));
- System.out.println(CreateSymbols(n * 2, '*'));
- }
- public static char CreateSymbols (int n, char symbol){
- for (int i = 0; i < n - 1; i++) {
- System.out.print(symbol);
- }
- return symbol;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement