criyle/codenet-compile-errors huggingface dataset:
Language: C

include<stdio.h>
#define MAX 100000
 
int parent(int);
int left(int);
int right(int);
 
int main(){
  int H,i,A[MAX+1];
 
  scanf("%d",&H);
 
  for(i=1;i<=H;i++){
    scanf("%d",&A[i]);
  }
 
  for(i=1;i<=H;i++){
    printf("node %d: key = %d, ",i,A[i]);
    if(parent(i)>=1){
      printf("parent key = %d, ",A[parent(i)]);
    }
    if(left(i)<=h){
      printf("left key = %d, ",A[left(i)]); 
    }
    if(right(i)<=H){
      printf("right key = %d, ",A[right(i)]);
    }
   
  }
 printf("\n")
  return 0;
}
 
int parent(int x){
  return x/2;
}
 
int left(int x){
  return 2*x;
}
 
int right(int x){
  return 2*x+1;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c: In function 'main':
main.c:11:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   11 |   scanf("%d",&H);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include<stdio.h>
main.c:11:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   11 |   scanf("%d",&H);
      |   ^~~~~
main.c:11:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:18:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   18 |     printf("node %d: key = %d, ",i,A[i]);
      |     ^~~~~~
main.c:18:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:18:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:18:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:19:8: error: implicit declaration of function 'parent' [-Wimplicit-function-declaration]
   19 |     if(parent(i)>=1){
      |        ^~~~~~
main.c:22:17: error: 'h' undeclared (first use in this function)
   22 |     if(left(i)<=h){
      |                 ^
main.c:22:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:30:2: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   30 |  printf("\n")
      |  ^~~~~~
main.c:30:2: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:30:14: error: expected ';' before 'return'
   30 |  printf("\n")
      |              ^
      |              ;
   31 |   return 0;
      |   ~~~~~~
Language: C

include<stdio.h>
#define MAX 100000
 
int parent(int);
int left(int);
int right(int);
 
int main(){
  int H,i,A[MAX+1];
 
  scanf("%d",&H);
 
  for(i=1;i<=H;i++){
    scanf("%d",&A[i]);
  }
 
  for(i=1;i<=H;i++){
    printf("node %d: key = %d, ",i,A[i]);
    if(parent(i)>=1){
      printf("parent key = %d, ",A[parent(i)]);
    }
    if(left(i)<=h){
      printf("left key = %d, ",A[left(i)]); 
    }
    if(right(i)<=H){
      printf("right key = %d, ",A[right(i)]);
    }
   
  
 printf("\n")
}
  return 0;
}
 
int parent(int x){
  return x/2;
}
 
int left(int x){
  return 2*x;
}
 
int right(int x){
  return 2*x+1;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c: In function 'main':
main.c:11:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   11 |   scanf("%d",&H);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include<stdio.h>
main.c:11:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   11 |   scanf("%d",&H);
      |   ^~~~~
main.c:11:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:18:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   18 |     printf("node %d: key = %d, ",i,A[i]);
      |     ^~~~~~
main.c:18:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:18:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:18:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:19:8: error: implicit declaration of function 'parent' [-Wimplicit-function-declaration]
   19 |     if(parent(i)>=1){
      |        ^~~~~~
main.c:22:17: error: 'h' undeclared (first use in this function)
   22 |     if(left(i)<=h){
      |                 ^
main.c:22:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:30:14: error: expected ';' before '}' token
   30 |  printf("\n")
      |              ^
      |              ;
   31 | }
      | ~
Language: C

include<stdio.h>
#define MAX 100000
 
int parent(int);
int left(int);
int right(int);
 
int main(){
  int H,i,A[MAX+1];
 
  scanf("%d",&H);
 
  for(i=1;i<=H;i++){
    scanf("%d",&A[i]);
  }
 
  for(i=1;i<=H;i++){
    printf("node %d: key = %d, ",i,A[i]);
    if(parent(i)>=1){
      printf("parent key = %d, ",A[parent(i)]);
    }
    if(left(i)<=h){
      printf("left key = %d, ",A[left(i)]); 
    }
    if(right(i)<=H){
      printf("right key = %d, ",A[right(i)]);
    }
 printf("\n")
}
  return 0 ;
}
 
int parent(int x){
  return x/2;
}
 
int left(int x){
  return 2*x;
}
 
int right(int x){
  return 2*x+1;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c: In function 'main':
main.c:11:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   11 |   scanf("%d",&H);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include<stdio.h>
main.c:11:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   11 |   scanf("%d",&H);
      |   ^~~~~
main.c:11:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:18:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   18 |     printf("node %d: key = %d, ",i,A[i]);
      |     ^~~~~~
main.c:18:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:18:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:18:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:19:8: error: implicit declaration of function 'parent' [-Wimplicit-function-declaration]
   19 |     if(parent(i)>=1){
      |        ^~~~~~
main.c:22:17: error: 'h' undeclared (first use in this function)
   22 |     if(left(i)<=h){
      |                 ^
main.c:22:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:28:14: error: expected ';' before '}' token
   28 |  printf("\n")
      |              ^
      |              ;
   29 | }
      | ~
Language: C

include<stdio.h>
#define MAX 100000
 
int parent(int);
int left(int);
int right(int);
 
int main(){
  int H,i,A[MAX+1];
 
  scanf("%d",&H);
 
  for(i=1;i<=H;i++){
    scanf("%d",&A[i]);
  }
 
  for(i=1;i<=H;i++){
    printf("node %d: key = %d, ",i,A[i]);
    if(parent(i)>=1){
      printf("parent key = %d, ",A[parent(i)]);
    }
    if(left(i)<=h){
      printf("left key = %d, ",A[left(i)]); 
    }
    if(right(i)<=H){
      printf("right key = %d, ",A[right(i)]);
    }
 printf("\n");
}
  return 0 ;
}
 
int parent(int x){
  return x/2;
}
 
int left(int x){
  return 2*x;
}
 
int right(int x){
  return 2*x+1;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c: In function 'main':
main.c:11:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   11 |   scanf("%d",&H);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include<stdio.h>
main.c:11:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   11 |   scanf("%d",&H);
      |   ^~~~~
main.c:11:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:18:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   18 |     printf("node %d: key = %d, ",i,A[i]);
      |     ^~~~~~
main.c:18:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:18:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:18:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:19:8: error: implicit declaration of function 'parent' [-Wimplicit-function-declaration]
   19 |     if(parent(i)>=1){
      |        ^~~~~~
main.c:22:17: error: 'h' undeclared (first use in this function)
   22 |     if(left(i)<=h){
      |                 ^
main.c:22:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<stdlib.h>
typedef struct node{
  int key;
  struct node *p, *l, *r;
}T_node;
int main(){
  int n;
  scanf("%d", &n);
  T_node *heap[n + 1];
  int i;
  for(i = 0; i <= n; i++)
    heap[i] = (T_node *)malloc(sizeof(T_node));
  for(i = 1; i <= n; i++){
    heap[i]->p = heap[i]->l = heap[i]->r = NULL;
    scanf("%d", &(heap[i]->key));
    if(floor(i /2) != 0){
      heap[i]->p = heap[floor(i / 2)];
      if(i % 2)
	heap[floor(i / 2)]->r = heap[i];
      else
	heap[floor(i / 2)]->l = heap[i];
    }
  }
  for(i = 1; i <= n; i++){
    printf("node %d: key = %d, ", i, heap[i]->key);
    if(heap[i]->p != NULL)
      printf("parent key = %d, ", heap[i]->p->key);
    if(heap[i]->l != NULL)
      printf("left key = %d, ", heap[i]->l->key);
    if(heap[i]->r != NULL)
      printf("right key = %d, ", heap[i]->r->key);
    printf("\n");
  }
  free(heap);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:17:8: error: implicit declaration of function 'floor' [-Wimplicit-function-declaration]
   17 |     if(floor(i /2) != 0){
      |        ^~~~~
main.c:3:1: note: include '<math.h>' or provide a declaration of 'floor'
    2 | #include<stdlib.h>
  +++ |+#include <math.h>
    3 | typedef struct node{
main.c:17:8: warning: incompatible implicit declaration of built-in function 'floor' [-Wbuiltin-declaration-mismatch]
   17 |     if(floor(i /2) != 0){
      |        ^~~~~
main.c:17:8: note: include '<math.h>' or provide a declaration of 'floor'
main.c:18:24: error: array subscript is not an integer
   18 |       heap[i]->p = heap[floor(i / 2)];
      |                        ^
main.c:20:13: error: array subscript is not an integer
   20 |         heap[floor(i / 2)]->r = heap[i];
      |             ^
main.c:22:13: error: array subscript is not an integer
   22 |         heap[floor(i / 2)]->l = heap[i];
      |             ^
Language: C

include<stdio.h>
#define MAX 100000
 
int parent(int);
int left(int);
int right(int);
 
int main(){
  int H,i,A[MAX+1];
 
  scanf("%d",&h);
 
  for(i=1;i<=h;i++){
    scanf("%d",&A[i]);
  }
 
  for(i=1;i<=h;i++){
    printf("node %d: key = %d, ",i,A[i]);
    if(parent(i)>=1){
      printf("parent key = %d, ",A[parent(i)]);
    }
    if(left(i)<=h){
      printf("left key = %d, ",A[left(i)]); 
    }
    if(right(i)<=h){
      printf("right key = %d, ",A[right(i)]);
    }
    printf("\n");
  }
 
  return 0;
}
 
int parent(int x){
  return x/2;
}
 
int left(int x){
  return 2*x;
}
 
int right(int x){
  return 2*x+1;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c: In function 'main':
main.c:11:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   11 |   scanf("%d",&h);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include<stdio.h>
main.c:11:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   11 |   scanf("%d",&h);
      |   ^~~~~
main.c:11:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:11:15: error: 'h' undeclared (first use in this function)
   11 |   scanf("%d",&h);
      |               ^
main.c:11:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   18 |     printf("node %d: key = %d, ",i,A[i]);
      |     ^~~~~~
main.c:18:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:18:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:18:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:19:8: error: implicit declaration of function 'parent' [-Wimplicit-function-declaration]
   19 |     if(parent(i)>=1){
      |        ^~~~~~
Language: C

include<stdio.h>
#define MAX 100000
 
int parent(int);
int left(int);
int right(int);
 
int main(){
  int h,i,A[MAX+1];
 
  scanf("%d",&h);
 
  for(i=1;i<=h;i++){
    scanf("%d",&A[i]);
  }
 
  for(i=1;i<=h;i++){
    printf("node %d: key = %d, ",i,A[i]);
    if(parent(i)>=1){
      printf("parent key = %d, ",A[parent(i)]);
    }
    if(left(i)<=h){
      printf("left key = %d, ",A[left(i)]); 
    }
    if(right(i)<=h){
      printf("right key = %d, ",A[right(i)]);
    }
    printf("\n");
  }
 
  return 0;
}
 
int parent(int x){
  return x/2;
}
 
int left(int x){
  return 2*x;
}
 
int right(int x){
  return 2*x+1;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
main.c: In function 'main':
main.c:11:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   11 |   scanf("%d",&h);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include<stdio.h>
main.c:11:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   11 |   scanf("%d",&h);
      |   ^~~~~
main.c:11:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:18:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   18 |     printf("node %d: key = %d, ",i,A[i]);
      |     ^~~~~~
main.c:18:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:18:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:18:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:19:8: error: implicit declaration of function 'parent' [-Wimplicit-function-declaration]
   19 |     if(parent(i)>=1){
      |        ^~~~~~
Language: C

#include <stdio.h>
#define MAX 251

int A[MAX];

int parent(int i){
  return i/2;
}

int left(int i){
  return 2*i;
}

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

int main(){
  int i,H;
  scanf("%d",&H);
  for(i=1; i<=H; i++) scnaf("%d",A[i]);
  
  for(i=1; i<=H; i++){
    printf("node %d: key = %d, ",i,A[i]);
    if(i==1) printf("left key = %d, right key = %d\n",left(i),right(i));
    else{
      if(left(i)<= H) printf("left key = %d,",left(i));
      if(right(i) <= H) printf("right key = %d,",right(i));
      printf("\n");
    }
  }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:21:23: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   21 |   for(i=1; i<=H; i++) scnaf("%d",A[i]);
      |                       ^~~~~
      |                       scanf
Language: C

#include<stdio.h>

#define Max 250

typedef struct{
  int key;
  int parent;
  int left;
  int right;
}Node;

int main(){
  int i, H;
  Node T[Max];

  scanf("%d",&H);
  for(i = 1; i <= H; i++){
    T[i].parent = NULL;
    T[i].left = NULL;
    T[i].right = NULL;
  }
  for(i = 1; i <= H; i++){
    scanf("%d",&T[i].key);
    if(i > 1) T[i].parent = T[i / 2].key;
  }
  for(i = 1; i <= H; i++){
    T[i].left = T[2 * i].key;
    T[i].right = T[2 * i + 1].key;
  }

  for(i = 1; i <= H; i++){
    printf("node %d: key = %d," ,i, T[i].key);
    if(T[i].parent != NULL) printf(" parent key = %d,", T[i].parent);
    if(T[i].left != NULL) printf(" left key = %d,", T[i].left);
    if(T[i].right != NULL) printf(" right key = %d,", T[i].right);
    printf(" \n");
  }

  return 0;

Compiler output:
main.c: In function 'main':
main.c:18:17: error: assignment to 'int' from 'void *' makes integer from pointer without a cast [-Wint-conversion]
   18 |     T[i].parent = NULL;
      |                 ^
main.c:19:15: error: assignment to 'int' from 'void *' makes integer from pointer without a cast [-Wint-conversion]
   19 |     T[i].left = NULL;
      |               ^
main.c:20:16: error: assignment to 'int' from 'void *' makes integer from pointer without a cast [-Wint-conversion]
   20 |     T[i].right = NULL;
      |                ^
main.c:33:20: warning: comparison between pointer and integer
   33 |     if(T[i].parent != NULL) printf(" parent key = %d,", T[i].parent);
      |                    ^~
main.c:34:18: warning: comparison between pointer and integer
   34 |     if(T[i].left != NULL) printf(" left key = %d,", T[i].left);
      |                  ^~
main.c:35:19: warning: comparison between pointer and integer
   35 |     if(T[i].right != NULL) printf(" right key = %d,", T[i].right);
      |                   ^~
main.c:39:3: error: expected declaration or statement at end of input
   39 |   return 0;
      |   ^~~~~~
Language: C

include<stdio.h>
#define H 250

int main(){
  int num,i,node[H];

  scanf("%d",&num);

  for(i=1; i<=num; i++){
    scanf("%d",&node[i]);
  }

  for(i=1; i<=num; i++){
    printf("node %d: key = %d, ",i ,node[i]);
    if(i!=1) printf("parent key = %d, ",node[i/2]);
    if(i*2<=num) printf("left key = %d, ",node[2*i]);
    if(i*2+1<=num)printf("right key = %d, ",node[2*i+1]);
    printf("\n");
  }



  return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

#include <stdio.h>
  
#define MAX 250

int main(){
  
  int H[MAX];
  int n;
  int i;
  
  scanf("%d",&n);

  for( i = 1 ; i <= n ; i++ )
    scanf("%d",&A[i]);
  
  for( i = 1 ; i <= n ; i++ ) {
    
    printf("node %d: key = %d, ",i,A[i]);

    if( i/2 > 0 ) printf("parent key = %d, ",A[i/2]);

    if( i*2 <= n ) printf("left key = %d, ",A[i*2]);

    if( i*2+1 <= n ) printf("right key = %d, ",A[i*2+1]);

    printf("\n");
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:17: error: 'A' undeclared (first use in this function)
   14 |     scanf("%d",&A[i]);
      |                 ^
main.c:14:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int64_t data[2 ^ 250];

int32_t main(void)
{
  int64_t num;
  scanf("%ld", &num);

  uint32_t i;
  for (i = 0; i < num; i++) {
    scanf("%ld", &data[i]);
  }

  for (i = 0; i < num; i++) {
    printf("node %u: key = %ld, ", i + 1, data[i]);
    if (0 < ((i + 1) / 2)) {
      printf("parent key = %ld, ", data[((i + 1) / 2) - 1]);
    }

    if (2 * (i + 1) < (num + 1)) {
      printf("left key = %ld, ", data[2 * (i + 1) - 1]);
    }

    if ((2 * (i + 1) + 1) < (num + 1)) {
      printf("right key = %ld, ", data[2 * (i + 1) + 1 - 1]);
    }
    printf("\n");
  }

  return 0;
}
#endif

Compiler output:
main.c:3:1: error: unknown type name 'int64_t'
    3 | int64_t data[2 ^ 250];
      | ^~~~~~~
main.c:2:1: note: 'int64_t' is defined in header '<stdint.h>'; this is probably fixable by adding '#include <stdint.h>'
    1 | #include <stdio.h>
  +++ |+#include <stdint.h>
    2 | 
main.c:5:1: error: unknown type name 'int32_t'
    5 | int32_t main(void)
      | ^~~~~~~
main.c:5:1: note: 'int32_t' is defined in header '<stdint.h>'; this is probably fixable by adding '#include <stdint.h>'
main.c: In function 'main':
main.c:7:3: error: unknown type name 'int64_t'
    7 |   int64_t num;
      |   ^~~~~~~
main.c:7:3: note: 'int64_t' is defined in header '<stdint.h>'; this is probably fixable by adding '#include <stdint.h>'
main.c:10:3: error: unknown type name 'uint32_t'
   10 |   uint32_t i;
      |   ^~~~~~~~
main.c:10:3: note: 'uint32_t' is defined in header '<stdint.h>'; this is probably fixable by adding '#include <stdint.h>'
main.c: At top level:
main.c:33:2: error: #endif without #if
   33 | #endif
      |  ^~~~~
Language: C

#include <stdio.h>
#include <stdint.h>

int64_t data[2 ^ 250];

int32_t main(void)
{
  int64_t num;
  scanf("%ld", &num);

  uint32_t i;
  for (i = 0; i < num; i++) {
    scanf("%ld", &data[i]);
  }

  for (i = 0; i < num; i++) {
    printf("node %u: key = %ld, ", i + 1, data[i]);
    if (0 < ((i + 1) / 2)) {
      printf("parent key = %ld, ", data[((i + 1) / 2) - 1]);
    }

    if (2 * (i + 1) < (num + 1)) {
      printf("left key = %ld, ", data[2 * (i + 1) - 1]);
    }

    if ((2 * (i + 1) + 1) < (num + 1)) {
      printf("right key = %ld, ", data[2 * (i + 1) + 1 - 1]);
    }
    printf("\n");
  }

  return 0;
}
#endif

Compiler output:
main.c:34:2: error: #endif without #if
   34 | #endif
      |  ^~~~~
Language: C

#include<stdio.h>

int parent(int i){
  return i/2;
}

int left(int i){
  return 2*i;
}

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

int mian(){

  int i, H, A[250+1];
  scanf("%d", &H);
  for(i=1; i<=H; i++) scanf("%d", &A[i]);
  for(i=1; i<=H; i++){
    printf("node %d: key = %d, ", i, A[i]);
    if(parent(i) >= 1) printf("parent key = %d, ", A[parent(i)]);
    if(left(i) <= H) printf("left key = %d, ", A[left(i)]);
    if(right(i) <= H) printf("right = %d, ", A[right(i)]);
    printf("\n");
  }
  return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>

int parent(int);
int left(int);
int right(int);

int main(){
  int i, n;
  int left, right;
  int key[251];

  scanf("%d",&n);

  for(i=1;i<=n;i++){
    scanf("%d",&key[i]);
  }

  for(i=1;i<=n;i++){

    printf("node = %d: key = %d, ", i, key[i]);

    left = left(i);
    right = right(i);

    if(i != 1) printf("parent key = %d, ", key[parent(i)]);
    if(left <= n) printf("left key = %d, ", key[left]);
    if(right <= n) printf("right key = %d, ", key[right]);

    printf("\n");
  }
}

int parent(int i){
  return i/2;
}

int left(int i){
  return 2*i;
}

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

Compiler output:
main.c: In function 'main':
main.c:22:12: error: called object 'left' is not a function or function pointer
   22 |     left = left(i);
      |            ^~~~
main.c:9:7: note: declared here
    9 |   int left, right;
      |       ^~~~
main.c:23:13: error: called object 'right' is not a function or function pointer
   23 |     right = right(i);
      |             ^~~~~
main.c:9:13: note: declared here
    9 |   int left, right;
      |             ^~~~~
Language: C

#include <stdio.h>

#define MAX 250;

int Parent(int);
int Left(int);
int Right(int);

int main(){
  int i, n;
  int left, right;
  int key[MAX];

  scanf("%d",&n);

  for(i=1;i<=n;i++){
    scanf("%d",&key[i]);
  }

  for(i=1;i<=n;i++){

    printf("node = %d: key = %d, ", i, key[i]);

    left = Left(i);
    right = Right(i);

    if(i != 1) printf("parent key = %d, ", key[Parent(i)]);
    if(left <= n) printf("left key = %d, ", key[left]);
    if(right <= n) printf("right key = %d, ", key[right]);

    printf("\n");
  }
}

int Parent(int i){
  return i/2;
}

int Left(int i){
  return 2*i;
}

int Right(int i){
  return 2*i+1;
}

Compiler output:
main.c: In function 'main':
main.c:3:16: error: expected ']' before ';' token
    3 | #define MAX 250;
      |                ^
main.c:12:11: note: in expansion of macro 'MAX'
   12 |   int key[MAX];
      |           ^~~
main.c:17:17: error: 'key' undeclared (first use in this function)
   17 |     scanf("%d",&key[i]);
      |                 ^~~
main.c:17:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

#define MAX 250

int Parent(int);
int Left(int);
int Right(int);

int main(){
  int i, n;
  int left, right, parent;
  int key[MAX];

  scanf("%d",&n);

  for(i=1;i<=n;i++){
    scanf("%d",&key[i]);
  }

  for(i=1;i<=n;i++){

    printf("node = %d: key = %d, ", i, key[i]);

    left = Left(i);
    right = Right(i);
    parent = Parent(i);

    if(parent >= 1) printf("parent key = %d, ", key[parent]);
    if(left <= n) printf("left key = %d, ", key[left]);
    if(right <= n) printf("right key = %d, ", key[right]);

    printf("\n");
  }
  return 0;
}

int Parent(int i){
  return (i/2);
}

int Left(int i){
  return 2*i;
}

Compiler output:
/usr/bin/ld: /tmp/ccuD9OZ8.o: in function `main':
main.c:(.text+0xaa): undefined reference to `Right'
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>

#define MAX 251
#define NIL 2000000001

main(){
  int i,n,k[MAX];

  for(i=0;i<H;i++){
    heap[i]=NIL;
  }
  scanf("%d",&n);

  for(i=1;i<=n;i++){
    scanf("%d",&k[i]);
  }

  for(i=1;i<=n;i++){
    printf("node %d: key = %d, ",i,k[i]);
    
    if(k[i/2]!=NIL) printf("parent key = %d, ",k[i/2]);

    if(2*i<=n && k[2*i]!=NIL) printf("left key = %d, ",k[2*i]);
    
    if(2*i+1<=n && k[2*i+1]!=NIL) printf("right key = %d, ",k[2*i+1]);
    
    printf("\n");
  }

  return 0;
}

Compiler output:
main.c:6:1: error: return type defaults to 'int' [-Wimplicit-int]
    6 | main(){
      | ^~~~
main.c: In function 'main':
main.c:9:13: error: 'H' undeclared (first use in this function)
    9 |   for(i=0;i<H;i++){
      |             ^
main.c:9:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:5: error: 'heap' undeclared (first use in this function)
   10 |     heap[i]=NIL;
      |     ^~~~
Language: C

#include<stdio.h>

#define MAX 251
#define NIL 2000000001

main(){
  int i,n,k[MAX];

  for(i=0;i<H;i++){
    k[i]=NIL;
  }
  scanf("%d",&n);

  for(i=1;i<=n;i++){
    scanf("%d",&k[i]);
  }

  for(i=1;i<=n;i++){
    printf("node %d: key = %d, ",i,k[i]);
    
    if(k[i/2]!=NIL) printf("parent key = %d, ",k[i/2]);

    if(2*i<=n && k[2*i]!=NIL) printf("left key = %d, ",k[2*i]);
    
    if(2*i+1<=n && k[2*i+1]!=NIL) printf("right key = %d, ",k[2*i+1]);
    
    printf("\n");
  }

  return 0;
}

Compiler output:
main.c:6:1: error: return type defaults to 'int' [-Wimplicit-int]
    6 | main(){
      | ^~~~
main.c: In function 'main':
main.c:9:13: error: 'H' undeclared (first use in this function)
    9 |   for(i=0;i<H;i++){
      |             ^
main.c:9:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <stdlib.h>

int parent(int);
int left(int);
int right(int);

int main(){
  int a,l,r,*A;
  int i;

  scanf("%d",&a);
  A=(int *)malloc(sizeof(int)*(a+1));
  
  for(i=1;i<=a;i++){
    scanf("%d",&A[i]);
  }

  for(i=1;i<=a;i++){
    printf("node %d: key = %d, ",i,A[i]);
    if(i!=1)printf("parent key = %d, ",A[parent(i)]);
    if((l=left(i)<=a)printf("left key = %d, ",A[l]);
    if((r=right(i)<=a)printf("right key = %d, ",A[r]);
    printf("\n");
  }

  return 0;
}

int parent(int i){
  return i/2;
}

int left(int i){
  return i*2;
}

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

Compiler output:
main.c: In function 'main':
main.c:22:22: error: expected ')' before 'printf'
   22 |     if((l=left(i)<=a)printf("left key = %d, ",A[l]);
      |       ~              ^~~~~~
      |                      )
main.c:28:1: error: expected expression before '}' token
   28 | }
      | ^
main.c:40:1: error: expected declaration or statement at end of input
   40 | }
      | ^
Language: C

#include <stdio.h>
#define N 251

int main() {
  int i, h;
  int A[N];

  scanf("%d", &h);
  for(i = 1; i <= n; i++) {
    scanf("%d", &A[i]);
  }

  for(i = 1; i <= h; i++) {
    printf("node %d: key = %d, ", i, A[i]);
    if(i != 1) printf("parent key = %d, ", A[i/2]);
    if(i*2 <= h) printf("left key = %d, ", A[i*2]);
    if(i*2+1 <= h) printf("right key = %d, ", A[i*2+1]);
    printf("\n");
  }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:19: error: 'n' undeclared (first use in this function)
    9 |   for(i = 1; i <= n; i++) {
      |                   ^
main.c:9:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main(){

  int n,i,a;
  int S[100001];
  
  scanf("%d",&n);

  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }

  for(i=0;i<=n;i++){
    printtf("node %d: key = %d, ",i,S[i]);
    if(i/2 >= 1){
      printf("parent key = %d, ",S[i/2]);
    }
    if(2*i <= n){
      printf("left key = %d, ",S[2*i]);
    }
    if(2*i+1 <= n){
      printf("right key = %d ",S[2*i+1]);
    }
    printf("\n");
  }
   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:5: error: implicit declaration of function 'printtf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   15 |     printtf("node %d: key = %d, ",i,S[i]);
      |     ^~~~~~~
      |     printf
Language: C

#include <stdio.h>
#include <stdlib.h>
 
int main(){
  int n,a,i;
  int id=1;
  int *heap;
 
  scanf("%d", &n);
  heap = (int *)malloc(sizeof(int)*(n+1));
  for(i=0; i<n; i++){
    scanf("%d", &a);
    heap[i + 1] = a;
  }
  for(; id<=n; id++){
    printf("node %d: ", id);
    printf("key = %d, ", heap[id]);
    if(id/2 > 0)
      printf("parent key = %d, ", heap[id/2]);
    if(id*2 <= n)
      printf("left key = %d, ", heap[id*2]);
    if(id*2+1 <= n)
      printf("right key = %d, ", heap[id*2+1]);
    putchar('\n');
  }
  return 0;

Compiler output:
main.c: In function 'main':
main.c:26:3: error: expected declaration or statement at end of input
   26 |   return 0;
      |   ^~~~~~
Language: C

#include<stdio.h>
??
struct intree{
????int parent;
????int left;
????int right;
????int key;
};
??
int size;
struct intree li[100000];

int parent1(int i){
??????return li[i/2].key;
}
??
int left1(int i){
????return li[2*i].key;
????
}
??
int right1(int i){
????return li[2*i+1].key;?? 
????
}
??
int main(void){
????int i,j;
??????
????scanf("%d",&si);
????for(i=1;i<=si;i++) scanf("%d",&li[i].key);
??????
??????
????for(i=1;i<=si;i++){
????????if(i!=1) li[i].parent=parent1(i);
????????else?? li[i].parent=-1;?? 
????????li[i].left=left1(i);
????????li[i].right=right1(i);
????}
??????
??????
????for(i=1;i<=si;i++){
????????printf("node %d: ",i);
????????printf("key = %d, ",li[i].key);?? 
????????if(i!=1)
????????????printf("parent key = %d, ",li[i].parent);
????????if(si>=2*i)
????????????printf("left key = %d, ",li[i].left);
????????if(si>=2*i+1)
????????????printf("right key = %d, ",li[i].right);
????????printf("\n");?? 
????}
????return 0;
}

Compiler output:
main.c:2:1: error: expected identifier or '(' before '?' token
    2 | ??
      | ^
main.c:9:1: error: expected identifier or '(' before '?' token
    9 | ??
      | ^
main.c:11:15: error: array type has incomplete element type 'struct intree'
   11 | struct intree li[100000];
      |               ^~
main.c: In function 'parent1':
main.c:14:1: error: expected expression before '?' token
   14 | ??????return li[i/2].key;
      | ^
main.c: At top level:
main.c:16:1: error: expected identifier or '(' before '?' token
   16 | ??
      | ^
main.c:21:1: error: expected identifier or '(' before '?' token
   21 | ??
      | ^
main.c:26:1: error: expected identifier or '(' before '?' token
   26 | ??
      | ^
Language: C

#include<stdio.h>
??
struct intree{
????int parent;
????int left;
????int right;
????int key;
};
??
int si;
struct intree li[100000];

int parent1(int i){
??????return li[i/2].key;
}
??
int left1(int i){
????return li[2*i].key;
????
}
??
int right1(int i){
????return li[2*i+1].key;?? 
????
}
??
int main(void){
????int i,j;
??????
????scanf("%d",&si);
????for(i=1;i<=si;i++) scanf("%d",&li[i].key);
??????
??????
????for(i=1;i<=si;i++){
????????if(i!=1) li[i].parent=parent1(i);
????????else?? li[i].parent=-1;?? 
????????li[i].left=left1(i);
????????li[i].right=right1(i);
????}
??????
??????
????for(i=1;i<=si;i++){
????????printf("node %d: ",i);
????????printf("key = %d, ",li[i].key);?? 
????????if(i!=1)
????????????printf("parent key = %d, ",li[i].parent);
????????if(si>=2*i)
????????????printf("left key = %d, ",li[i].left);
????????if(si>=2*i+1)
????????????printf("right key = %d, ",li[i].right);
????????printf("\n");?? 
????}
????return 0;
}

Compiler output:
main.c:2:1: error: expected identifier or '(' before '?' token
    2 | ??
      | ^
main.c:9:1: error: expected identifier or '(' before '?' token
    9 | ??
      | ^
main.c:11:15: error: array type has incomplete element type 'struct intree'
   11 | struct intree li[100000];
      |               ^~
main.c: In function 'parent1':
main.c:14:1: error: expected expression before '?' token
   14 | ??????return li[i/2].key;
      | ^
main.c: At top level:
main.c:16:1: error: expected identifier or '(' before '?' token
   16 | ??
      | ^
main.c:21:1: error: expected identifier or '(' before '?' token
   21 | ??
      | ^
main.c:26:1: error: expected identifier or '(' before '?' token
   26 | ??
      | ^
Language: C


#include<stdio.h>
#include<stdlib.h>
  
int main(){
  int i,n,*A;
  scanf("%d",&n);
    A = (int*)malloc(sizeof(int)*n);
  for(i=1;i<=n;i++)
    scanf("%d",&A[i]);
  
  for(i=1;i<=n;i++){
    printf("node %d: key = %d, ",i,A[i]);
    if(parent(i) >= 1)printf("parent key = %d, ",A[i/2]);
    if(left(i) <= n)printf("left key = %d, ",A[i*2]);
    if(right(i) <= n)printf("right key = %d, ",A[i*2+1]);
    printf("\n");
  }
  
  return 0;

Compiler output:
main.c: In function 'main':
main.c:14:8: error: implicit declaration of function 'parent' [-Wimplicit-function-declaration]
   14 |     if(parent(i) >= 1)printf("parent key = %d, ",A[i/2]);
      |        ^~~~~~
main.c:15:8: error: implicit declaration of function 'left' [-Wimplicit-function-declaration]
   15 |     if(left(i) <= n)printf("left key = %d, ",A[i*2]);
      |        ^~~~
main.c:16:8: error: implicit declaration of function 'right' [-Wimplicit-function-declaration]
   16 |     if(right(i) <= n)printf("right key = %d, ",A[i*2+1]);
      |        ^~~~~
main.c:20:3: error: expected declaration or statement at end of input
   20 |   return 0;
      |   ^~~~~~
Language: C

include <stdio.h>
#define N 25
 
int Parent(int);
int LeftC(int);
int RightC(int);
 
int main(){
  int n,i;
  int num[N];
 
  scanf("%d",&n);
  for(i=1;i<=n;i++){
    scanf("%d",&num[i]);
  }
  for(i=1;i<=n;i++){
    printf("node %d: key = %d, ",i,num[i]);
    if(Parent(i)>=1) printf("parent key = %d, ",num[Parent(i)]);
    if(n>=LeftC(i)) printf("left key = %d, ",num[LeftC(i)]);
    if(n>=RightC(i)) printf("right key = %d, ",num[RightC(i)]);
    printf("\n");
  }
  return 0;
}
 
int Parent(int i){
  return i/2;
}
 
int LeftC(int i){
  return 2*i;
}
 
int RightC(int i){
  return 2*i+1;
}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
main.c: In function 'main':
main.c:12:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   12 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include <stdio.h>
main.c:12:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   12 |   scanf("%d",&n);
      |   ^~~~~
main.c:12:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:17:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   17 |     printf("node %d: key = %d, ",i,num[i]);
      |     ^~~~~~
main.c:17:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:17:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:17:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:18:8: error: implicit declaration of function 'Parent' [-Wimplicit-function-declaration]
   18 |     if(Parent(i)>=1) printf("parent key = %d, ",num[Parent(i)]);
      |        ^~~~~~
Language: C

include <stdio.h>
#define N 250
 
int Parent(int);
int LeftC(int);
int RightC(int);
 
int main(){
  int n,i;
  int num[N];
 
  scanf("%d",&n);
  for(i=1;i<=n;i++){
    scanf("%d",&num[i]);
  }
  for(i=1;i<=n;i++){
    printf("node %d: key = %d, ",i,num[i]);
    if(Parent(i)>=1) printf("parent key = %d, ",num[Parent(i)]);
    if(n>=LeftC(i)) printf("left key = %d, ",num[LeftC(i)]);
    if(n>=RightC(i)) printf("right key = %d, ",num[RightC(i)]);
    printf("\n");
  }
  return 0;
}
 
int Parent(int i){
  return i/2;
}
 
int LeftC(int i){
  return 2*i;
}
 
int RightC(int i){
  return 2*i+1;
}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
main.c: In function 'main':
main.c:12:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   12 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include <stdio.h>
main.c:12:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   12 |   scanf("%d",&n);
      |   ^~~~~
main.c:12:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:17:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   17 |     printf("node %d: key = %d, ",i,num[i]);
      |     ^~~~~~
main.c:17:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:17:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:17:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:18:8: error: implicit declaration of function 'Parent' [-Wimplicit-function-declaration]
   18 |     if(Parent(i)>=1) printf("parent key = %d, ",num[Parent(i)]);
      |        ^~~~~~
Language: C

#include<stdio.h>
   
#define MAX 1000000
   int parent(int i){
   
  return i/2;
}
   
int left(int i){
   
  return 2 * i;
}
   
int right(int i){
   
  return 2 * i + 1;
}
int main(){
  int i,n,A[MAX+1];
   
  scanf("%d",&n);
  for(i=1;i<=n;i++)
    scanf("%d",&A[i]);
   
  for(i=1;i<=n;i++){
    printf("node %d: key = %d, ",i,A[i]);
    if(parent(i) >= 1)printf("parent key = %d, ",A[parent(i)]);
    if(left(i) <= n)printf("left key = %d, ",A[left(i)]);
    if(right(i) <= n)printf("right key = %d, ",A[right(i)]);
    printf("\n");
  }
   
  return 0
}

Compiler output:
main.c: In function 'main':
main.c:33:11: error: expected ';' before '}' token
   33 |   return 0
      |           ^
      |           ;
   34 | }
      | ~
Language: C

#include<iostrean>
using namespace std;
#define MAX 100000
int parent(int i){return i/2;}
int left(int i){return 2*i;}
int right(int i){return 2*i+1;}
int main(){
  int H,i,A[MAX+1];
  scanf("%d",&H);
  for(i=1;i<=H;i++){
    scanf("%d",&A[i]);
  }
  for(i=1;i<=H;i++){

    if(parent(i)>=1);


  }
  return 0;
}

Compiler output:
main.c:1:9: fatal error: iostrean: No such file or directory
    1 | #include<iostrean>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>
#define MAX 500000
int heap[MAX];
int n;

void getmax(int i){
  int l=2*i;
  int r=2*i+1;
  int m,p;

  if(l<=n && heap[i]< heap[l]){
    m=l;
    }
    else {
      m=i;
    }
    if(heap[r] > heap[m] && r<=n){
      m=r;
    }
    if(m!=i){
      p=heap[i];
      heap[i]=heap[m];
      heap[m]=p;
      getmax(m);
    }
}
//void build(void){
  //int i;
  //for(i=(int)(n/2);i>=1;i--){
  //getmax(i);
  //}
//}
int main(){
  int i;
  scanf("%d",&n);
  for(i=1;i<=n;i++){
    scanf("%d",&heap[i]);
  }
  //printf("agasdfga\n");
 for(i=(int)(n/2);i>=1;i--){
    getmax(i);
  }

  build();
  for(i = 1;i <= n;i++){
    printf(" %d",heap[i]);
  }
  printf("\n");

  return 0;

}

Compiler output:
main.c: In function 'main':
main.c:44:3: error: implicit declaration of function 'build' [-Wimplicit-function-declaration]
   44 |   build();
      |   ^~~~~
Language: C

#include<stdio.h>
#define MAX 1000000

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

int main(){
  int n,i,A[MAX+1];

  scanf("%d",&n);
  for(i=0;i<=n;i++) {
    scanf("&d",&A[i]);
  }

  for(i=0;i<=n;i++){
    printf("node %d: key = %d, ",i,A[i]);

    if(parent(i)>=1) printf("parent key = %d, ",A[parent(i)]);
    if(left(i)<=n) printf("left key = %d, ",A[left(i)]);
    if(right(i)<=1) printf("right key = %d, ",A[right(i)]);

    printf("\n");
  }

  return 0;

Compiler output:
main.c: In function 'main':
main.c:26:3: error: expected declaration or statement at end of input
   26 |   return 0;
      |   ^~~~~~
Language: C

#include<stdio.h>
#define MAX 1000000

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

int main(){
  int n,i,A[MAX+1];

  scanf("%d",&n);
  for(i=0;i<=n;i++) {
    scanf("&d",&A[i]);
  }

  for(i=0;i<=n;i++){
    printf("node %d: key = %d, ",i,A[i]);

    if(parent(i)>=1) printf("parent key = %d, ",A[parent(i)]);
    if(left(i)<=n) printf("left key = %d, ",A[left(i)]);
    if(right(i)<=n) printf("right key = %d, ",A[right(i)]);

    printf("\n");
  }

  return 0;

Compiler output:
main.c: In function 'main':
main.c:26:3: error: expected declaration or statement at end of input
   26 |   return 0;
      |   ^~~~~~
Language: C

#include<stdio.h>
#define NI NTL
#define H 250

int parent(int );
int left(int );
int right(int );

int P[H];
int main(){
  int n,i,p,left,right;
  scanf("%d", &n);
  for(i = 0;i<n;i++){
    scanf("%d" , &P[i]);
  }
  for(i = 0;i<=n;i++){
    printf("node %d: key = %d, ",i+1,P[i]);
    p = parent(i+1);
  if(p!=0){
    printf("parent key = %d", A[p]);
  }
  left = left(i+1);
  if(left <= n){
    printf("left key = %d, ", A[left]
}
 
      right = right(i+1);
    if(right <= n){
      printf("right key = %d, ",A[right]);
    }
    printf("\n");
  }
  return 0;
}
int parent(int i){
  return i/2;
}
int left(int i){
  return 2*i;
}
int right(int i){
  return 2*i+1;
}

Compiler output:
main.c: In function 'main':
main.c:20:31: error: 'A' undeclared (first use in this function)
   20 |     printf("parent key = %d", A[p]);
      |                               ^
main.c:20:31: note: each undeclared identifier is reported only once for each function it appears in
main.c:22:10: error: called object 'left' is not a function or function pointer
   22 |   left = left(i+1);
      |          ^~~~
main.c:11:13: note: declared here
   11 |   int n,i,p,left,right;
      |             ^~~~
main.c:24:38: error: expected ')' before '}' token
   24 |     printf("left key = %d, ", A[left]
      |           ~                          ^
      |                                      )
   25 | }
      | ~                                     
main.c:24:38: error: expected ';' before '}' token
   24 |     printf("left key = %d, ", A[left]
      |                                      ^
      |                                      ;
   25 | }
      | ~                                     
main.c:27:15: error: called object 'right' is not a function or function pointer
   27 |       right = right(i+1);
      |               ^~~~~
main.c:11:18: note: declared here
   11 |   int n,i,p,left,right;
      |                  ^~~~~
Language: C

#include<stdio.h>
#define NI NTL
#define H 250

int parent(int );
int left(int );
int right(int );

int P[H];
int main(){
  int n,i,p,left,right;
  scanf("%d", &n);
  for(i = 1;i<n;i++){
    scanf("%d" , &P[i]);
  }
  for(i = 1;i<=n;i++){
    printf("node %d: key = %d, ",i,P[i]);
    p = parent(i);
  if(p!=0){
    printf("parent key = %d", A[p]);
  }
  left = left(i);
  if(left <= n){
    printf("left key = %d, ", A[left]
}
 
      right = right(i);
    if(right <= n){
      printf("right key = %d, ",A[right]);
    }
    printf("\n");
  }
  return 0;
}
int parent(int i){
  return i/2;
}
int left(int i){
  return 2*i;
}
int right(int i){
  return 2*i+1;
}

Compiler output:
main.c: In function 'main':
main.c:20:31: error: 'A' undeclared (first use in this function)
   20 |     printf("parent key = %d", A[p]);
      |                               ^
main.c:20:31: note: each undeclared identifier is reported only once for each function it appears in
main.c:22:10: error: called object 'left' is not a function or function pointer
   22 |   left = left(i);
      |          ^~~~
main.c:11:13: note: declared here
   11 |   int n,i,p,left,right;
      |             ^~~~
main.c:24:38: error: expected ')' before '}' token
   24 |     printf("left key = %d, ", A[left]
      |           ~                          ^
      |                                      )
   25 | }
      | ~                                     
main.c:24:38: error: expected ';' before '}' token
   24 |     printf("left key = %d, ", A[left]
      |                                      ^
      |                                      ;
   25 | }
      | ~                                     
main.c:27:15: error: called object 'right' is not a function or function pointer
   27 |       right = right(i);
      |               ^~~~~
main.c:11:18: note: declared here
   11 |   int n,i,p,left,right;
      |                  ^~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>

void parent(int i){
  printf("parent key = ");
  if(i%2==0) printf("%d,",A[parent(i/2)]);
  else return printf("%d,",A[parent(i-1)/2]);
}
int left(int i){
  if(0<2*i && 2*i<=h) printf(" left key = %d,",A[left(2*i)]);
}
int right(int i){
   if(0<2*i+1 && 2*i+1<=h) printf(" right key = %d,"A[right(i*2+1)]);
}
int *A;
int main(){
  int h,i;
  scanf("%d",&h);
  A=(int *)malloc(h * sizeof(int));
  for(i=1;i<=h;i++){
    scanf("%d",&A[i]);
  }

  for(i=1;i<=h;i++){
    printf("node %d: key = %d, ",i,A[i]);
    if(i!=1) parent(i);
    left(i);
    right(i)
    printf("\n");
  }
  free(A);
  return 0;
}

Compiler output:
main.c: In function 'parent':
main.c:6:27: error: 'A' undeclared (first use in this function)
    6 |   if(i%2==0) printf("%d,",A[parent(i/2)]);
      |                           ^
main.c:6:27: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:30: error: void value not ignored as it ought to be
    7 |   else return printf("%d,",A[parent(i-1)/2]);
      |                              ^~~~~~~~~~~
main.c:7:15: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
    7 |   else return printf("%d,",A[parent(i-1)/2]);
      |               ^~~~~~
main.c:4:6: note: declared here
    4 | void parent(int i){
      |      ^~~~~~
main.c: In function 'left':
main.c:10:20: error: 'h' undeclared (first use in this function)
   10 |   if(0<2*i && 2*i<=h) printf(" left key = %d,",A[left(2*i)]);
      |                    ^
main.c:10:48: error: 'A' undeclared (first use in this function)
   10 |   if(0<2*i && 2*i<=h) printf(" left key = %d,",A[left(2*i)]);
      |                                                ^
main.c: In function 'right':
main.c:13:25: error: 'h' undeclared (first use in this function)
   13 |    if(0<2*i+1 && 2*i+1<=h) printf(" right key = %d,"A[right(i*2+1)]);
      |                         ^
main.c:13:53: error: expected ')' before 'A'
   13 |    if(0<2*i+1 && 2*i+1<=h) printf(" right key = %d,"A[right(i*2+1)]);
      |                                  ~                  ^
      |                                                     )
main.c: In function 'main':
main.c:28:13: error: expected ';' before 'printf'
   28 |     right(i)
      |             ^
      |             ;
   29 |     printf("\n");
      |     ~~~~~~