MapleStory Finger Point

๐Ÿ”ต C,C++,C#/๐Ÿ“šCore C_Programming

[C/Core C Programming] Chapter9.๋ฌธ์ž์—ด

HYEJU01 2023. 3. 27. 19:30
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#define SIZE 50
int check_time_str(char phon[]);

int main() {
    char phon[20];
    check_time_str(phon);

    return 0;
}

int check_time_str(char phon[]) {
    char x[4] = "010";
    while (1)
    {
        printf("์ „ํ™”๋ฒˆํ˜ธ ์ž…๋ ฅ(. ์ž…๋ ฅ์‹œ ์ข…๋ฃŒ)\n");
        gets(phon);

         if (strlen(phon) == 11) {
             if (strncmp(phon, x, 3) == 0) {
                 printf("%s ๋Š” ์œ ํšจํ•œ ์ „ํ™”๋ฒˆํ˜ธ ์ž…๋‹ˆ๋‹ค\n", phon);
             }
         }
        else if(strcmp(phon,".")==0){
            break;
        }

        else
        {
            printf("์ž˜๋ชป ์ž…๋ ฅํ–ˆ์Šต๋‹ˆ๋‹ค. 01012345678 ํ˜•์‹์œผ๋กœ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”\n");
        }

    }
}