728x90
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;
}
}
728x90
'코딩테스트 > [C#] 프로그래머스' 카테고리의 다른 글
[프로그래머스 | Lv.0] 정수 부분 (0) | 2023.08.13 |
---|---|
[프로그래머스 | Lv.0] 짝수는 싫어요 (0) | 2023.08.13 |
[프로그래머스 | Lv.0] 중앙값 구하기 (0) | 2023.08.13 |
[프로그래머스 | Lv.0] 문자열안에 문자열 (0) | 2023.08.13 |
[프로그래머스 | Lv.0] 삼각형의 완성조건 (1) (0) | 2023.08.13 |