6841
#include <stdio.h>
#include <string.h>
int main(void){
char str[31];
while (strcmp(str, "TTYL") != 0){
scanf("%s", &str);
if (strcmp(str, "CU") == 0){
printf("see you");
}
else if (strcmp(str, ":-)") == 0){
printf("I’m happy");
}
else if (strcmp(str, ":-(") == 0){
printf("I’m unhappy");
}
else if (strcmp(str, ";-)") == 0){
printf("wink");
}
else if (strcmp(str, ":-P") == 0){
printf("stick out my tongue");
}
else if (strcmp(str, "(~.~)") == 0){
printf("sleepy");
}
else if (strcmp(str, "TA") == 0){
printf("totally awesome");
}
else if (strcmp(str, "CCC") == 0){
printf("Canadian Computing Competition");
}
else if (strcmp(str, "CUZ") == 0){
printf("because");
}
else if (strcmp(str, "TY") == 0){
printf("thank-you");
}
else if (strcmp(str, "YW") == 0){
printf("you’re welcome");
}
else if (strcmp(str, "TTYL") == 0){
printf("talk to you later");
}
else{
printf("%s", str);
}
printf("\n");
}
return 0;
}

문자열 비교 나중에 정리해야지
'백준' 카테고리의 다른 글
| [ 백준 / C ] 1009번 : 분산처리 (3) | 2025.07.14 |
|---|---|
| [ 백준 / C ] 1357번 : 뒤집힌 덧셈 (3) | 2025.07.11 |
| [ 백준 / C ] 2752번 : 세수정렬 (0) | 2025.07.09 |
| [ 백준 / C ] 11945번 : 뜨거운 붕어빵 (1) | 2025.07.08 |
| [ 백준 / C ] 31429번 : SUAPC 2023 Summer (0) | 2025.07.07 |