Language: C

include<stdio.h>
#include<limits.h>
int num,tmp;
int S[20000000];


int parent(int i){
  return i/2;
}
int left(int i){
  return 2*i;
}
int right(int i){
  return 2*i+1;
}



void heapIncreaseKey(int i,int key){
  if(S[i]>key){
    return ;
  }


  S[i]=key;
  while(i>1 && S[parent(i)]<S[i]){
    tmp=S[i];
    S[i]=S[parent(i)];
    S[parent(i)]=tmp;
    i=parent(i);
  }
}



void maxHeapInsert(int key){
  num=num+1;
  S[num]=-1000;
  heapIncreaseKey(num,key);
}



void maxHeapify(int i){
  int l,r,largest,tmp;
  l= left(i);
  r =right(i);
  if(l<=num && S[l]>S[i])largest =l;
  else largest =i;
  if(r<=num &&S[r]>S[largest])largest=r;
  if(largest != i){
    tmp=S[i];
    S[i]=S[largest];
    S[largest]=tmp;
    maxHeapify(largest);
  }
}

//?????§?????????????????? S ???????´???? S ????????????????????????????????????                                                                                                                                                                                    

int heapExtractMax(){
  int Max;

  if(num<1){
    return 0;
  }

  Max=S[1];
  S[1]=S[num];
  num=num-1;
  maxHeapify(1);
  return Max;
}


int main(){
 char b[100];
 int j;
  while(1){
    scanf("%s",b);
    if(b[0] =='i') {
      scanf("%d",&j);
      maxHeapInsert(j);
              }

    else if(b[1]=='x'){
      printf("%d\n",heapExtractMax());
      }
 else break;
    }

      return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c: In function 'heapIncreaseKey':
main.c:27:5: error: 'tmp' undeclared (first use in this function)
   27 |     tmp=S[i];
      |     ^~~
main.c:27:5: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'maxHeapInsert':
main.c:37:3: error: 'num' undeclared (first use in this function)
   37 |   num=num+1;
      |   ^~~
main.c: In function 'maxHeapify':
main.c:48:9: error: 'num' undeclared (first use in this function)
   48 |   if(l<=num && S[l]>S[i])largest =l;
      |         ^~~
main.c: In function 'heapExtractMax':
main.c:64:6: error: 'num' undeclared (first use in this function)
   64 |   if(num<1){
      |      ^~~
main.c: In function 'main':
main.c:80:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   80 |     scanf("%s",b);
      |     ^~~~~
main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    2 | #include<limits.h>
  +++ |+#include <stdio.h>
    3 | int num,tmp;
main.c:80:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   80 |     scanf("%s",b);
      |     ^~~~~
main.c:80:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:87:7: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   87 |       printf("%d\n",heapExtractMax());
      |       ^~~~~~
main.c:87:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:87:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:87:7: note: include '<stdio.h>' or provide a declaration of 'printf'