[프로그래머스 | Lv.0] 옷가게 할인 받기

이승민·2023년 8월 4일
0

프로그래머스

목록 보기
21/27

https://school.programmers.co.kr/learn/courses/30/lessons/120818?language=csharp

📝 나의 풀이

using System;

public class Solution {
    public int solution(int price) {
        int answer = 0;
        
        if(price>=500000){
            answer=(int) (price*0.8);
        } else if (price >= 300000){
            answer=(int) (price*0.9);
        } else if (price >=100000){
            answer=(int)(price*0.95);
        } else {answer=price;}
        
        
        return answer;
    }
}

0개의 댓글

관련 채용 정보