✏️ 문제풀이/프로그래머스

[프로그래머스/Java] Lv0. 숫자 비교하기

bono-hye 2025. 1. 12. 21:40

| 문제

https://school.programmers.co.kr/learn/courses/30/lessons/120807

 

프로그래머스

SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프

programmers.co.kr

 

 

| 풀이

class Solution {
    public int solution(int num1, int num2) {
        int answer = 0;
        if(num1 == num2)
            answer = 1;
        else
            answer = -1;
        return answer;
    }
}