미소를뿌리는감자의 코딩
[백준 2024/01/30] 4999번 아! 본문
728x90
https://www.acmicpc.net/problem/4999
1. 접근 방법
이번 문제는 첫 번째로 input을 받은 값과 두 번째로 input을 받은 값을 비교한 후
길이 비교에 따라 no 또는 go를 출력하도록 만들었다.
2. 코드
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class b4999 {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String doctor = reader.readLine();
String patient = reader.readLine();
if(doctor.length() < patient.length()){
System.out.println("no");
}
else{
System.out.println("go");
}
}
}
728x90
'코딩 테스트 > 백준' 카테고리의 다른 글
[백준 2024/02/05] 10809번 알파벳 찾기 (1) | 2024.02.05 |
---|---|
[백준 2024/02/01] b1271 엄청난 부자2 (0) | 2024.02.01 |
[백준 2024/01/29] 10814번 나이순 정렬 (1) | 2024.01.30 |
[백준 2024/01/28] 11650번 좌표 정렬하기 (1) | 2024.01.29 |
[백준 2024/01/27] 11286번 절댓값 힙 (0) | 2024.01.27 |