[CodeUp] #4056-연말 정산(정올 1번 수준 문제)

chrmqgozj·2022년 1월 21일
0

CodeUp

목록 보기
11/48
#include <iostream>
using namespace std;

int calc(int n){
    if(n<=500){
        return n*0.7;
    }
    else if(n>500 && n<=1500){
        return 350+(n-500)*0.4;
    }
    else if(n>1500 && n<=4500){
        return 750+(n-1500)*0.15;
    }
    else if(n>4500 && n<=10000){
        return 1200 + (n-4500)*0.05;
    }
    else{
        return 1475 + (n-10000)*0.02;
    }
}

int main(){
    int num;
    cin >> num;

    int ans = calc(num);
    cout << ans;
}

0개의 댓글

Powered by GraphCDN, the GraphQL CDN