Search

옷가게 할인 받기

알고리즘
코딩테스트 입문
플랫폼
프로그래머스
JCF
Math
상태
해결
생성 일시
2024/02/21 10:52
최종 편집 일시
2024/02/21 11:05

문제 설명

해결과정

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
복사