Development Project

[ Baekjoon - 09/17 ] - 23810번: 골뱅이 찍기 - 뒤집힌 ㅋ 본문

CodingTest/Baekjoon

[ Baekjoon - 09/17 ] - 23810번: 골뱅이 찍기 - 뒤집힌 ㅋ

나를 위한 시간 2022. 9. 17. 16:13
 

23810번: 골뱅이 찍기 - 뒤집힌 ㅋ

서준이는 아빠로부터 골뱅이가 들어 있는 상자를 생일 선물로 받았다. 상자 안에는 뒤집힌 ㅋ자 모양의 골뱅이가 들어있다. 뒤집힌 ㅋ자 모양은 가로 및 세로로 각각 5개의 셀로 구성되어 있다.

www.acmicpc.net

 

  • 소요 시간 : 7분

 

  • 정답 코드
import java.io.*;
import java.util.*;

public class Main{
    static int N;
    static String[] f = {"@@@@@","@","@@@@@","@","@"};
    static StringBuilder sb = new StringBuilder();

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        N = Integer.parseInt(br.readLine());

        for (int i = 0; i < f.length; i++) {
            for (int ni = 0; ni < N; ni++) {
                for (int nj = 0; nj < N; nj++) {
                    sb.append(f[i]);
                }
                sb.append("\n");
            }
        }

        System.out.println(sb.toString());
    }
}
Comments