Language: C

#include<stdio.h>
#include<stdlib.h>
#define M 1046527
#define NIL -1

 int H[1000000];

 int getchar(char moji[]){
              if(moji=='A')return 1;
              else if (moji=='C')return 2;
              else if (moji=='G')return 3;
              else if (moji=='T')return 4;
              }

 int getkey(char moji[]){
         int i,sum=0,p=1;
         for(i=0;i<strlen(moji);i<n){
                    sum+=p*getchar(moji[i]);
                    p+=5;
                   }
         return sum;
         }

 int h1(int key){return key%M;}

 int h2(int key){return 1+(key%(M-1));}

 int search(char moji){
            int i,h,key;
            key=getkey(moji);
            for(i=0;;i++){
                    h=(h1(key)+i*h2(key))%M;
                    if(strcmp(H[h],str)==0){return 1;}
                    else if(strlen(H[h]==0){return 0;}
                    }

 int insert(char moji){
            int i,h,key;
            key=getkey(moji);
            for(i=0;;i++){
                    h=(h1(key)+i*h2(key))%M;
                    if(strcmp(H[h],str)==0)return 1;
                    else if(strlen(H[h]==0){
                                   strcpy(H[h],str);
                                   return 0;
                                   }
                    }
            }

 int main(){
       int n,i;
       char com[7];
       char moji[12];
 
       scanf("%d",&n);
       for(i=0;i<n;i++){
               scanf("%s%s",&com,&moji);
               if(com[0]=='i'){insert(moji);}
               else(com[0]=='f'){
                           if(search(moji)){printf("yes\n");}
                           else{printf("no\n");}
               }
       return 0;
       }









Compiler output:
main.c:8:6: error: conflicting types for 'getchar'; have 'int(char *)'
    8 |  int getchar(char moji[]){
      |      ^~~~~~~
In file included from main.c:1:
/usr/include/stdio.h:582:12: note: previous declaration of 'getchar' with type 'int(void)'
  582 | extern int getchar (void);
      |            ^~~~~~~
main.c: In function 'getchar':
main.c:9:22: warning: comparison between pointer and integer
    9 |               if(moji=='A')return 1;
      |                      ^~
main.c:10:28: warning: comparison between pointer and integer
   10 |               else if (moji=='C')return 2;
      |                            ^~
main.c:11:28: warning: comparison between pointer and integer
   11 |               else if (moji=='G')return 3;
      |                            ^~
main.c:12:28: warning: comparison between pointer and integer
   12 |               else if (moji=='T')return 4;
      |                            ^~
main.c: In function 'getkey':
main.c:17:20: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   17 |          for(i=0;i<strlen(moji);i<n){
      |                    ^~~~~~
main.c:3:1: note: include '<string.h>' or provide a declaration of 'strlen'
    2 | #include<stdlib.h>
  +++ |+#include <string.h>
    3 | #define M 1046527
main.c:17:20: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   17 |          for(i=0;i<strlen(moji);i<n){
      |                    ^~~~~~
main.c:17:20: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:17:35: error: 'n' undeclared (first use in this function)
   17 |          for(i=0;i<strlen(moji);i<n){
      |                                   ^
main.c:17:35: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:40: error: passing argument 1 of 'getchar' makes pointer from integer without a cast [-Wint-conversion]
   18 |                     sum+=p*getchar(moji[i]);
      |                                    ~~~~^~~
      |                                        |
      |                                        char
main.c:8:19: note: expected 'char *' but argument is of type 'char'
    8 |  int getchar(char moji[]){
      |              ~~~~~^~~~~~
main.c: In function 'search':
main.c:30:24: error: passing argument 1 of 'getkey' makes pointer from integer without a cast [-Wint-conversion]
   30 |             key=getkey(moji);
      |                        ^~~~
      |                        |
      |                        char
main.c:15:18: note: expected 'char *' but argument is of type 'char'
   15 |  int getkey(char moji[]){
      |             ~~~~~^~~~~~
main.c:33:24: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
   33 |                     if(strcmp(H[h],str)==0){return 1;}
      |                        ^~~~~~
main.c:33:24: note: include '<string.h>' or provide a declaration of 'strcmp'
main.c:33:36: error: 'str' undeclared (first use in this function)
   33 |                     if(strcmp(H[h],str)==0){return 1;}
      |                                    ^~~
main.c:33:32: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   33 |                     if(strcmp(H[h],str)==0){return 1;}
      |                               ~^~~
      |                                |
      |                                int
main.c:33:32: note: expected 'const char *' but argument is of type 'int'
main.c:34:29: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   34 |                     else if(strlen(H[h]==0){return 0;}
      |                             ^~~~~~
main.c:34:29: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:34:40: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
   34 |                     else if(strlen(H[h]==0){return 0;}
      |                                    ~~~~^~~
      |                                        |
      |                                        int
main.c:34:40: note: expected 'const char *' but argument is of type 'int'
main.c:34:44: error: expected ')' before '{' token
   34 |                     else if(strlen(H[h]==0){return 0;}
      |                            ~               ^
      |                                            )
main.c:35:21: error: expected expression before '}' token
   35 |                     }
      |                     ^
main.c: In function 'insert':
main.c:39:24: error: passing argument 1 of 'getkey' makes pointer from integer without a cast [-Wint-conversion]
   39 |             key=getkey(moji);
      |                        ^~~~
      |                        |
      |                        char
main.c:15:18: note: expected 'char *' but argument is of type 'char'
   15 |  int getkey(char moji[]){
      |             ~~~~~^~~~~~
main.c:42:32: error: passing argument 1 of 'strcmp' makes pointer from integer without a cast [-Wint-conversion]
   42 |                     if(strcmp(H[h],str)==0)return 1;
      |                               ~^~~
      |                                |
      |                                int
main.c:42:32: note: expected 'const char *' but argument is of type 'int'
main.c:43:29: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   43 |                     else if(strlen(H[h]==0){
      |                             ^~~~~~
main.c:43:29: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:43:40: error: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
   43 |                     else if(strlen(H[h]==0){
      |                                    ~~~~^~~
      |                                        |
      |                                        int
main.c:43:40: note: expected 'const char *' but argument is of type 'int'
main.c:43:44: error: expected ')' before '{' token
   43 |                     else if(strlen(H[h]==0){
      |                            ~               ^
      |                                            )
main.c:47:21: error: expected expression before '}' token
   47 |                     }
      |                     ^
main.c: In function 'main':
main.c:58:39: error: passing argument 1 of 'insert' makes integer from pointer without a cast [-Wint-conversion]
   58 |                if(com[0]=='i'){insert(moji);}
      |                                       ^~~~
      |                                       |
      |                                       char *
main.c:37:18: note: expected 'char' but argument is of type 'char *'
   37 |  int insert(char moji){
      |             ~~~~~^~~~
main.c:59:33: error: expected ';' before '{' token
   59 |                else(com[0]=='f'){
      |                                 ^
      |                                 ;
main.c:64:8: error: expected declaration or statement at end of input
   64 |        }
      |        ^
main.c: In function 'search':
main.c:64:8: error: expected declaration or statement at end of input