#include <stdio.h>
int main() {
/*
switch (조건) {
case 값1:
실행할 코드1;
break;
case 값2:
실행할 코드2;
break;
default:
어떤 case도 해당하지 않을 때 실행할 코드
} */
int menu;
scanf("%d", &menu);
switch (menu) {
case 1:
printf("아메리카노\n");
break;
case 2:
printf("카페라떼\n");
break;
case 3:
printf("딸기 스무디\n");
break;
default:
printf("다시 주문하세요\n");
}
char c;
scanf(" %c", &c);
switch (c) {
case '+':
case '-':
case '*':
case '/':
printf("연산자입니다.\n");
break;
default:
printf("연산 기호가 아닙니다\n");
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: