#include <stdio.h>

int Compare ( char hana [ ], char dul [ ] )
{
        int i;

        for ( i = 0 ;  ; i ++ )
        {
                if ( hana [ i ] < dul [ i ] )
                        return -1;
                
                if ( hana [ i ] > dul [ i ] )
                        return +1;

                if ( hana [ i ] == '\0' )
                        return 0;
        }
}
int main(void)
{
   
        char str5 [20];
        char str6 [20];
        for ( ; ; ) 
       {
                printf ("Enter a word > (order) ");
                scanf ("%s", str5);

                printf ("Enter a another word > (order) ");
                scanf ("%s", str6);

                Compare (str5, str6);

                if ( Compare <= 0 )
                        printf ("%s, %s nn", str6, str5);
                else if ( Compare > 0 )
                        printf ("%s, %s nn", str5, str6);
         }
         return 0;
}

ABCD ABDC 이렇게 두개 입력하면 제대로 정렬이 되거든요 ABCD가 먼저 출력되고 그 다음에 ABDC

근데 ABCD 랑 AB 두개 입력하면 AB ABCD가 출력되어야 하는데 ABCD AB 이렇게 출력되요.

이거 바꾸려면 어떻게 해야되죠?

프갤 성님들께 정중히 여쭤봅니다 ㅠㅠ