728x90
반응형
SMALL
#include <string>
#include <vector>
using namespace std;
int solution(int price) {
if(price>=500000) return price*0.8;
else if(price>=300000 && price<500000) return price*0.9;
else if(price>=100000 && price<300000) return price*0.95;
else return price;
}
728x90
반응형
LIST
'C++' 카테고리의 다른 글
[프로그래머스] 개미 군단 (0) | 2025.09.05 |
---|---|
[프로그래머스] 직각삼각형 출력하기 (0) | 2025.09.04 |
[프로그래머스] 모음 제거 (0) | 2025.09.04 |
[프로그래머스] 중복된 숫자 개수 (0) | 2025.09.04 |
[프로그래머스] 특정 문자 제거하기 (0) | 2025.09.04 |
댓글