코딩테스트/백준(JAVA)

백준 코딩테스트 1-13-10172 개 코딩 문제 java로 푸는 방법

쏠솔랄라 2023. 3. 5. 15:15

 

 

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

1단계 입출력과 사칙연산의 마지막 단계인 13단계 10172번 문제입니다

 

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

 

10172번: 개

문제 아래 예제와 같이 개를 출력하시오. 입력 출력 예제 입력 1 복사 예제 출력 1 복사 |\_/| |q p| /} ( 0 )"""\ |"^"` | ||_/=\\__|...

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("|q p| /}");

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

System.out.println("|\"^\"` |");

System.out.println("||_/=\\\\__|");

}

}

 

=> 바로 직전 문제인 고양이 문제를 경험 삼아

바로 1줄마다 하나의 출력을 적용

" 큰따옴표를 출력하기 위해서는 앞에 \역슬래쉬를 붙여준다

\ 마찬가지로 역슬래쉬를 출력하고 싶을 때도 \역슬래쉬를 하나 추가한다

 

 

 


 

 

1-1-2557 Hello World https://developernew.tistory.com/41 <- 백준 답지 제출 방법
1-2-1000 A+B https://developernew.tistory.com/42
1-3-1001 A-B https://developernew.tistory.com/43
1-4-10998 AXB https://developernew.tistory.com/44
1-5-1008 A/B https://developernew.tistory.com/45
1-6-10869 사칙연산 https://developernew.tistory.com/46
1-7-10926 ??! https://developernew.tistory.com/47
1-8-18108 1998년생인 내가 태국에서는 2541년생?! 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
1-12-10171 고양이 https://developernew.tistory.com/52