#include <stdio.h>

int main() {
    int money, select;
    scanf("%d", &money);
    scanf("%d", &select);

    switch(select){
        case 1:
            if(money < 2000){
                printf("돈이 부족합니다.\n");
            }else{
                money = money - 2000;
                printf("콜라가 구입되었습니다.\n");
                printf("거스름 돈: %d\n", money);
            }
            break;
        case 2:
            if(money < 1800){
                printf("돈이 부족합니다.\n");
            }else{
                money = money - 1800;
                printf("팝콘이 구입되었습니다.\n");
                printf("거스름 돈: %d\n", money);
            }
            break;
        case 3:
            if(money < 3000){
                printf("돈이 부족합니다.\n");
            }else{
                money = money - 3000;
                printf("도시락이 구입되었습니다.\n");
                printf("거스름 돈: %d\n", money);
            }
            break;
        default:
            printf("판매하지 않는 물건입니다.\n");
            break;
    }
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: