/*
1. 정수 N, M 선언
2. 정수 N과 M을 각각 입력받음
3. 거스름돈 = 낸 돈 - 음료 값
4. if문을 통해 1~3번이 각각 의미하는 음료를 지정
5. 잔돈 개수 계산하여 출력
*/
#include <stdio.h>

int main() {
    int N, M;
    scanf("%d", &N);
    scanf("%d", &M);
    int x = M - 500;
    int y = M - 400;
    int z = M - 300;

    if (N == 1) {
        printf("Americano\n");
        printf("%d %d", (x / 500), ((x % 500) / 100));
    }
    else if (N == 2) {
        printf("Cafe Latte\n");
        printf("%d %d", (y / 500), ((y % 500) / 100));
    }
    else if (N == 3) {
        printf("Lemon Tea\n");
        printf("%d %d", (z / 500), ((z % 500) / 100));
    }
    return 0;
}

Embed on website

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