![프로그래머스 Lv.0 조건 문자열](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FXE5C7%2FbtsBo8OY1tV%2FFmhkc2Pz7kKojLV2jVZSh0%2Fimg.png)
프로그래머스 Lv.0 조건 문자열개발자가 되기까지 (2023.08.16~2024.04.15)/[Algorithm] Programmers ver.Java2023. 12. 5. 01:06
Table of Contents
<Solution>
class Solution {
public int solution(String ineq, String eq, int n, int m) {
int answer = 0;
if (ineq.equals(">") && eq.equals("=")) {
answer = (n >= m) ? 1 : 0 ;
} else if (ineq.equals("<") && eq.equals("=")) {
answer = (n <= m) ? 1 : 0 ;
} else if (ineq.equals(">") && eq.equals("!")) {
answer = (n > m) ? 1 : 0 ;
} else if (ineq.equals("<") && eq.equals("!")) {
answer = (n < m) ? 1 : 0 ;
}
return answer;
}
}
728x90
@rlozlr :: 얼렁뚱땅 개발자
얼렁뚱땅 주니어 개발자
포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!