Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class SoftUniLogo {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int n = Integer.parseInt(scanner.nextLine());
- String firstLine = repeatStr(".", (12*n-6)/2)
- + "#"
- + repeatStr(".", (12*n-6)/2);
- System.out.println(firstLine);
- for (int i = 0; i < 2*n - 2; i++) {
- String roof = repeatStr(".", 6*n - 6 - 3*i)
- + repeatStr("#", 7 + 2*3*i)
- + repeatStr(".", 6*n - 6 - 3*i);
- System.out.println(roof);
- }
- String staticLine = repeatStr("#", 12*n - 5);
- System.out.println(staticLine);
- for (int i = 0; i < n-2; i++) {
- String underTheRoof = "|"
- + repeatStr(".", 2 + 3*i)
- + repeatStr("#", 12*n - 11 -2*3*i)
- + repeatStr(".", 3 + 3*i);
- System.out.println(underTheRoof);
- }
- for (int i = 1; i <=n ; i++) {
- if (i/n != 1){
- String bottom = "|"
- + repeatStr(".", (6*n-6)/2 - 1)
- + repeatStr("#", 6*n+1)
- + repeatStr(".", (6*n-6)/2);
- System.out.println(bottom);
- } else {
- String bottom = "@"
- + repeatStr(".", (6*n-6)/2 - 1)
- + repeatStr("#", 6*n+1)
- + repeatStr(".", (6*n-6)/2);
- System.out.println(bottom);
- }
- }
- }
- static String repeatStr(String strToRepeat, int count) {
- String text = "";
- for (int i = 0; i < count; i++) {
- text += strToRepeat;
- }
- return text;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement