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;
}

문자열 비교 나중에 정리해야지

+ Recent posts