반응형
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
반응형
'CodingTest' 카테고리의 다른 글
프로그래머스 - 코딩테스트 입문 Day 3 (0) | 2025.04.05 |
---|---|
프로그래머스 - 코딩테스트 입문 Day 2 (0) | 2025.04.05 |
백준 - 가장 가까운 공통 조상 (0) | 2025.03.10 |
BFS (3) - 석유 시추 (1) | 2025.02.06 |
BFS (2) - 게임 맵 최단거리 (0) | 2025.02.06 |