본문 바로가기
C++

[프로그래머스] 옷가게 할인 받기

by 띰쥬 2025. 9. 4.
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

댓글