문제 설명
해결과정
Solution.java
import java.util.*;
class Solution {
public int solution(int price) {
// int answer = 0;
if(500000 <= price) {
return Math.round((long)((double)price*0.8));
} else if(300000 <= price) {
return Math.round((long)((double)price*0.9));
} else if(100000 <= price) {
return Math.round((long)((double)price*0.95));
} else {
return price;
}
}
}
Java
복사