Language: C++

#include <stdio.h>

#include <string.h>

int judge(char str[3], char history[110][4]);

int main(void)
{
    char str[3];
    char output[4];
    char history[110][4];
    printf("?aaa\n");
    fflush(stdout);
    scanf("%s", str);
    int n = 0;
    strcpy(history[n], str);
    if ( str[0] != 'a' ) {
      printf("!OUT\n");
      fflush(stdout);
      return 0;
    }

    while (1) {
      if (judge(str[3], history[n]) == 0) {
        strcpy(output[4], str[3]);
        printf("?%saa\n", output);
        fflush(stdout);
        scanf("%s", str);
        n++;
        strcpy(history[n], str);
      } else {
        printf("!OUT\n");
        fflush(stdout);
        break;
      }
    }
    return 0;
}
int judge(char str[3], char history[110][4])
{
    int t;
    for (int k; k < 110 ; k++) {
      t = strcmp(str[3], history[k]);
        if (t == 1) {
          return t;
        }
        else {
        }
    }
    if (str[0] != 'a') {
      t = 1;
      return t;
    } else {
      t = 0;
    }
    return t;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:22: error: invalid conversion from 'char' to 'char*' [-fpermissive]
   24 |       if (judge(str[3], history[n]) == 0) {
      |                 ~~~~~^
      |                      |
      |                      char
a.cc:24:34: error: cannot convert 'char*' to 'char (*)[4]'
   24 |       if (judge(str[3], history[n]) == 0) {
      |                         ~~~~~~~~~^
      |                                  |
      |                                  char*
a.cc:5:29: note:   initializing argument 2 of 'int judge(char*, char (*)[4])'
    5 | int judge(char str[3], char history[110][4]);
      |                        ~~~~~^~~~~~~~~~~~~~~
a.cc:25:24: error: invalid conversion from 'char' to 'char*' [-fpermissive]
   25 |         strcpy(output[4], str[3]);
      |                ~~~~~~~~^
      |                        |
      |                        char
In file included from a.cc:3:
/usr/include/string.h:141:39: note:   initializing argument 1 of 'char* strcpy(char*, const char*)'
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |                      ~~~~~~~~~~~~~~~~~^~~~~~
a.cc:25:32: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   25 |         strcpy(output[4], str[3]);
      |                           ~~~~~^
      |                                |
      |                                char
/usr/include/string.h:141:70: note:   initializing argument 2 of 'char* strcpy(char*, const char*)'
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
a.cc: In function 'int judge(char*, char (*)[4])':
a.cc:43:23: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   43 |       t = strcmp(str[3], history[k]);
      |                  ~~~~~^
      |                       |
      |                       char
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~