class Solution {
public int solution(int price) {
int answer = 0;
double sub_ans = 0;
if(price >= 100000 && price < 300000) {
sub_ans = price * 0.95;
}else if(price >= 300000 && price < 500000) {
sub_ans = price * 0.9;
}else if(price >= 500000) {
sub_ans = price * 0.8;
}else {
sub_ans = price;
}
answer = (int)sub_ans;
return answer;
}
}
처음에 else문 안 써서 한번 틀렸음😭😭