JAVA 코딩 알고리즘 연습/프로그래머스
프로그래머스 - 옷가게 할인 받기 / JAVA (자바) 코딩 알고리즘 연습
easpop
2023. 2. 8. 15:49
728x90
반응형
반응형
class Solution {
public int solution(int price) {
int answer = 0;
if (price >= 500000) {
answer = price * 80 / 100;
} else if (price >= 300000 && price < 500000) {
answer = price * 90 / 100;
} else if (price >= 100000 && price < 300000) {
answer = price * 95 / 100;
}else{
answer = price;
}
return answer;
}
}
728x90
반응형