본문 바로가기
CodingTest

프로그래머스 - 코딩테스트 입문 Day 1

by Jiwon_Loopy 2025. 4. 5.
반응형

1. 두 수의 합 구하기


class Solution {
    public int solution(int num1, int num2) {
        return num1 + num2;
    }
}

 

 

2. 두 수의 차 구하기


class Solution {
    public int solution(int num1, int num2) {
        return num1 - num2;
    }
}

 

 

3. 두 수의 곱 구하기


class Solution {
    public int solution(int num1, int num2) {
        return num1 * num2;
    }
}

 

 

4. 몫 구하기


class Solution {
    public int solution(int num1, int num2) {
        return num1 / num2;
    }
}
728x90
반응형