int main() {

char *s1=NULL;

char *s2=NULL;


s1 = (char*)malloc(50);

s2 = (char*)malloc(50);


printf("입력하고자 하는 첫번째 문자열>>");

scanf("%[^\n]s", s1);


getchar();


printf("입력하고자 하는 두번째 문자열>>");

scanf(" %[^\n]s", s2);


printf("%d",my_strcmp(s1, s2));


free(s1);

free(s2);


return 0;

}

int my_strcmp(char* s1, char* s2) {

int i=0;

while (*s1!='\0'||*s2!='\0')
{
if (s1[i]
return -1;
else if (s1[i] > s2[i])
return  1;
i++;
}
return 0;
}

이렇게 짰는데 ㅅㅂ..



이렇게 나옴 ㅅㅂ.. 왜이럼 ㅠㅠㅠ