Language: C

#include <stdio.h>

char C1[12000], C2[12000];
const char yes[2][10] = {"No\n", "Yes\n"};

int int_hl_chr(char *C)
{
    int ans = 0;
    while (C[ans])
    {
        ans++;
    }
    return ans;
}

void voi_swap_chr(char &a, char &b)
{
    char c = a;
    a = b;
    b = c;
    return;
}

int int_min(int a, int b)
{
    return a <= b ? a : b;
}

bool bol_cre_chrs(char *A, char *B, int l1, int l2, bool b1 = true, bool b2 = true)
{
    int k = int_min(l1, l2);
    for (int i = 0; i < k; i++)
    {
        if (A[i] != B[i])
        {
            return b1 ? A[i] > B[i] : A[i] < B[i];
        }
    }
    return (l1 == l2) ? b2 : ((b1) ? (l1 > l2): (l1 < l2));
}

int main()
{
    gets(C1);
    gets(C2);
    int l1 = int_hl_chr(C1);
    int l2 = int_hl_chr(C2);
    for (int i = 1; i < l1; i++)
    {
        for (int j = i - 1; j >= 0; j--)
        {
            if (C1[i] > C1[j])
            {
                voi_swap_chr(C1[i], C1[j]);
            }
        }
    }
    for (int i = 1; i < l2; i++)
    {
        for (int j = i - 1; j >= 0; j--)
        {
            if (C2[i] < C2[j])
            {
                voi_swap_chr(C2[i], C2[j]);
            }
        }
    }
    printf(yes[bol_cre_chrs(C1, C2, l1, l2, false, false)]);
    return 0;
}


Compiler output:
main.c:16:24: error: expected ';', ',' or ')' before '&' token
   16 | void voi_swap_chr(char &a, char &b)
      |                        ^
main.c:29:1: error: unknown type name 'bool'
   29 | bool bol_cre_chrs(char *A, char *B, int l1, int l2, bool b1 = true, bool b2 = true)
      | ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include <stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c:29:53: error: unknown type name 'bool'
   29 | bool bol_cre_chrs(char *A, char *B, int l1, int l2, bool b1 = true, bool b2 = true)
      |                                                     ^~~~
main.c:29:53: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:29:69: error: unknown type name 'bool'
   29 | bool bol_cre_chrs(char *A, char *B, int l1, int l2, bool b1 = true, bool b2 = true)
      |                                                                     ^~~~
main.c:29:69: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c: In function 'main':
main.c:44:5: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   44 |     gets(C1);
      |     ^~~~
      |     fgets
main.c:54:17: error: implicit declaration of function 'voi_swap_chr' [-Wimplicit-function-declaration]
   54 |                 voi_swap_chr(C1[i], C1[j]);
      |                 ^~~~~~~~~~~~
main.c:68:16: error: implicit declaration of function 'bol_cre_chrs' [-Wimplicit-function-declaration]
   68 |     printf(yes[bol_cre_chrs(C1, C2, l1, l2, false, false)]);
      |                ^~~~~~~~~~~~
main.c:68:45: error: 'false' undeclared (first use in this function)
   68 |     printf(yes[bol_cre_chrs(C1, C2, l1, l2, false, false)]);
      |                                             ^~~~~
main.c:68:45: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:68:45: note: each undeclared identifier is reported only once for each function it appears in