코딩테스트/백준(JAVA)

백준 코딩테스트 1-12-10171 고양이 코딩 문제 java로 푸는 방법

쏠솔랄라 2023. 3. 5. 14:42

 

 

백준 코딩테스트 단계별로 풀어보기

1단계 입출력과 사칙연산의 12단계 10171번 문제입니다

 

https://www.acmicpc.net/problem/10171

 

10171번: 고양이

아래 예제와 같이 고양이를 출력하시오.

www.acmicpc.net

 

https://www.acmicpc.net/step

 

단계별로 풀어보기

단계별은 @jh05013님이 관리하고 계십니다. 단계제목설명정보총 문제내가 맞은 문제1입출력과 사칙연산입력, 출력과 사칙연산을 연습해 봅시다. Hello World!132조건문if 등의 조건문을 사용해 봅시다

www.acmicpc.net

 

 


 

 

 

 

문제
아래 예제와 같이 고양이를 출력하시오.

입력
없음.

출력
고양이를 출력한다.

 

 

정답

public class Main {

 

public static void main(String[] args) {

 

System.out.println("\\ /\\");

System.out.println(" ) ( ')");

System.out.println("( / )");

System.out.println(" \\(__)|");

}

}

 

=> 또다시 아주아주 쉽게

단순하게 출력해야 하는 문제

각각의 출력을 각 1줄로 출력해야 한다

 

public class Main {

public static void main(String[] args) {

System.out.println("\\ /\\\r\n"

+ " ) ( ')\r\n"

+ "( / )\r\n"

+ " \\(__)|");

}

}

어떤식으로 넣으라는 건지 몰라서

처음에 이렇게 막 넣어서 제출해봤다

당연히(?) 안 됐다

출력은 이렇게 똑같이 잘 되는구만...

 

 


 

 

1-1-2557 https://developernew.tistory.com/41 <- 백준 답지 제출 방법
1-2-1000 https://developernew.tistory.com/42
1-3-1001 https://developernew.tistory.com/43
1-4-10998 https://developernew.tistory.com/44
1-5-1008 https://developernew.tistory.com/45
1-6-10869 https://developernew.tistory.com/46
1-7-10926 https://developernew.tistory.com/47
1-8-18108 https://developernew.tistory.com/48
1-9-10430 https://developernew.tistory.com/49
1-10-2588 https://developernew.tistory.com/50
1-11-11382 https://developernew.tistory.com/51