Language: C

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

void s(int *, int *);
void maxheap(int*, int, int);
void buildmaxheap(int*, int);

main(){
????int h, i, *A;

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

????buildmaxheap(A, h);
????for(i=1; i<=h; i++){
????????printf(" %d", *(A+i));
????}
????printf("\n");

????free(A);
????return 0;
}

void s(int *a, int *b){
????int tmp;

????tmp = *a;
????*a = *b;
????*b = tmp;
}

void maxheap(int *A, int h, int i){
????int largest = i;
????int l = i*2;
????int r = i*2 + 1;

????if(l<=h && A[l] > A[i]) largest = l;
????if(r<=h && A[r] > A[largest]) largest = r;

????if(largest != i){
????????s(A+largest, A+i);
????????maxheap(A, h, largest);
????}
}

Compiler output:
main.c:8:1: error: return type defaults to 'int' [-Wimplicit-int]
    8 | main(){
      | ^~~~
main.c: In function 'main':
main.c:9:1: error: expected expression before '?' token
    9 | ????int h, i, *A;
      | ^
main.c:11:1: error: expected expression before '?' token
   11 | ????scanf("%d", &h);
      | ^
main.c:11:18: error: 'h' undeclared (first use in this function)
   11 | ????scanf("%d", &h);
      |                  ^
main.c:11:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:1: error: expected expression before '?' token
   12 | ????A = malloc(sizeof(int)*(h+1));
      | ^
main.c:12:5: error: 'A' undeclared (first use in this function)
   12 | ????A = malloc(sizeof(int)*(h+1));
      |     ^
main.c:12:34: error: expected ':' before ';' token
   12 | ????A = malloc(sizeof(int)*(h+1));
      |                                  ^
      |                                  :
main.c:13:1: error: expected expression before '?' token
   13 | ????for(i=1; i<=h; i++){
      | ^
main.c:18:1: error: expected expression before '?' token
   18 | ????for(i=1; i<=h; i++){
      | ^
main.c:23:1: error: expected expression before '?' token
   23 | ????free(A);
      | ^
main.c:24:1: error: expected expression before '?' token
   24 | ????return 0;
      | ^
main.c: In function 's':
main.c:28:1: error: expected expression before '?' token
   28 | ????int tmp;
      | ^
main.c:30:1: error: expected expression before '?' token
   30 | ????tmp = *a;
      | ^
main.c:30:5: error: 'tmp' undeclared (first use in this function)
   30 | ????tmp = *a;
      |     ^~~
main.c:31:1: error: expected expression before '?' token
   31 | ????*a = *b;
      | ^
main.c:32:1: error: expected expression before '?' token
   32 | ????*b = tmp;
      | ^
main.c: In function 'maxheap':
main.c:36:1: error: expected expression before '?' token
   36 | ????int largest = i;
      | ^
main.c:37:1: error: expected expression before '?' token
   37 | ????int l = i*2;
      | ^
main.c:38:1: error: expected expression before '?' token
   38 | ????int r = i*2 + 1;
      | ^
main.c:40:1: error: expected expression before '?' token
   40 | ????if(l<=h && A[l] > A[i]) largest = l;
      | ^
main.c:41:1: error: expected expression before '?' token
   41 | ????if(r<=h && A[r] > A[largest]) largest = r;
      | ^
main.c:43:1: error: expected expression before '?' token
   43 | ????if(largest != i){
      | ^