Language: C

#define MAX_INPUT 100000
/*??????????±???????????????°??????*/
typedef struct point_t{
  int x;
  int y;
} ;
typedef point_t* point_ptr_t;

int compare(const void*, const void*);
static double ccw(point_t*, point_t*, point_t*);
void convex_hull(point_t*, size_t, point_ptr_t**, size_t*);

int main(void)
{
    size_t npoints = 0; 
    int i;
    struct point_t aPoints[MAX_INPUT];
    point_ptr_t *ppHull;
    size_t hullsize = 0;

/*??§?¨??????????????????????*/
    for(i = 0; i < MAX_INPUT; i++){
        aPoints[i].x = NULL;
        aPoints[i].y = NULL;
    }



    scanf("%d", &npoints);
    for (i = 0; i < npoints; i++){
        scanf("%d %d", &aPoints[i].x, &aPoints[i].y);
    }

/*y??§?¨???§??????????????????*/
    qsort(aPoints, npoints, sizeof(point_t), compare);
/*y??§?¨?????????????????£????x??§?¨???§??????????????????*/
        if(aPoints[0].y == aPoints[1].y && aPoints[0].x > aPoints[1].x)
        {
            point_t temp;
            temp = aPoints[0];
            aPoints[0] = aPoints[1];
            aPoints[1] = temp;
        }
        if(aPoints[1].y == aPoints[2].y && aPoints[1].x > aPoints[2].x)
        {
            point_t temp;
            temp = aPoints[1];
            aPoints[1] = aPoints[2];
            aPoints[2] = temp;
        }
        if(aPoints[0].y == aPoints[2].y && aPoints[0].x > aPoints[2].x)
        {
            point_t temp;
            temp = aPoints[0];
            aPoints[0] = aPoints[2];
            aPoints[2] = temp;
        }
    for(i = 2; i < npoints - 1; i++)
    {
        if(aPoints[i].y == aPoints[i+1].y && aPoints[i].x > aPoints[i+1].x)
        {
            point_t temp;
            temp = aPoints[i];
            aPoints[i] = aPoints[i+1];
            aPoints[i+1] = temp;
            i -= 2;
        }
    }    

/*??????????????§??????
 *  for(i = 0; i < npoints; i++){
 *      printf("%d %d\n", aPoints[i].x, aPoints[i].y);
 *  }
 */
/*??????????±???????*/
    ppHull = (point_ptr_t*)calloc(npoints, sizeof(int));
    if (ppHull == NULL)
    {
        printf("memory error");
    }

    for(i = 0; i < npoints; i++)
    {
        ppHull[i] = NULL;
    }
    convex_hull(aPoints, npoints, &ppHull, &hullsize);

    printf("%d\n", hullsize);
    for(i = 0; i < hullsize; i++){
         printf("%d %d\n", ppHull[i]->x, ppHull[i]->y);
    }

/*    free(*outhull);
    free(outhull);
*/
    return 0;
}

/* ????????¢??° */
int compare(const void* c1, const void* c2)
{
    point_t t1 = *(point_t *)c1;
    point_t t2 = *(point_t *)c2;

    if(t1.y < t2.y){            /*y??§?¨???§?????????*/
        return -1;
    }else if(t1.y > t2.y){
        return 1;
    }else return 0;
}
/*??????????????????????????????????????????????????????
 *ccw > 0 ??§???????¨?????????????ccw < 0??§????¨???????
 */
static double ccw(point_t* p1, point_t* p2, point_t* p3)
{
    return (p2->x - p1->x)*(p3->y - p1->y) - (p2->y - p1->y)*(p3->x - p1->x);
}

/* ???????¨???????????????§???????????????????????????????????????
 * ?????????????´???¨?????????????´??????????????????¨???
 */
void convex_hull(point_t* points, size_t npoints, point_ptr_t** out_hull, size_t* out_hullsize)
{
    point_ptr_t* hull;
    int i, t;
    int k = 0;

    hull = *out_hull;

/* right hull */
    for (i = 0; i < npoints; ++i) {
        while (k >= 2 && ccw(hull[k-2], hull[k-1], &points[i]) < 0) --k;
        hull[k++] = &points[i];
    }

/* left hull */
    for (i = npoints - 2, t = k + 1; i >= 0; --i) {
        while (k >= t && ccw(hull[k-2], hull[k-1], &points[i]) < 0) --k;
        hull[k++] = &points[i];
    }
  
    *out_hull = hull;
    *out_hullsize = k - 1;

}

Compiler output:
main.c:6:1: warning: useless storage class specifier in empty declaration
    6 | } ;
      | ^
main.c:7:9: error: unknown type name 'point_t'
    7 | typedef point_t* point_ptr_t;
      |         ^~~~~~~
main.c:10:19: error: unknown type name 'point_t'; did you mean 'point_ptr_t'?
   10 | static double ccw(point_t*, point_t*, point_t*);
      |                   ^~~~~~~
      |                   point_ptr_t
main.c:10:29: error: unknown type name 'point_t'; did you mean 'point_ptr_t'?
   10 | static double ccw(point_t*, point_t*, point_t*);
      |                             ^~~~~~~
      |                             point_ptr_t
main.c:10:39: error: unknown type name 'point_t'; did you mean 'point_ptr_t'?
   10 | static double ccw(point_t*, point_t*, point_t*);
      |                                       ^~~~~~~
      |                                       point_ptr_t
main.c:11:18: error: unknown type name 'point_t'; did you mean 'point_ptr_t'?
   11 | void convex_hull(point_t*, size_t, point_ptr_t**, size_t*);
      |                  ^~~~~~~
      |                  point_ptr_t
main.c:11:28: error: unknown type name 'size_t'
   11 | void convex_hull(point_t*, size_t, point_ptr_t**, size_t*);
      |                            ^~~~~~
main.c:1:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
  +++ |+#include <stddef.h>
    1 | #define MAX_INPUT 100000
main.c:11:51: error: unknown type name 'size_t'
   11 | void convex_hull(point_t*, size_t, point_ptr_t**, size_t*);
      |                                                   ^~~~~~
main.c:11:51: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
main.c: In function 'main':
main.c:15:5: error: unknown type name 'size_t'
   15 |     size_t npoints = 0;
      |     ^~~~~~
main.c:15:5: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
main.c:19:5: error: unknown type name 'size_t'
   19 |     size_t hullsize = 0;
      |     ^~~~~~
main.c:19:5: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
main.c:23:24: error: 'NULL' undeclared (first use in this function)
   23 |         aPoints[i].x = NULL;
      |                        ^~~~
main.c:23:24: note: 'NULL' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
main.c:23:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:29:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   29 |     scanf("%d", &npoints);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #define MAX_INPUT 100000
main.c:29:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   29 |     scanf("%d", &npoints);
      |     ^~~~~
main.c:29:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:35:5: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
   35 |     qsort(aPoints, npoints, sizeof(point_t), compare);
      |     ^~~~~
main.c:35:36: error: 'point_t' undeclared (first use in this function)
   35 |     qsort(aPoints, npoints, sizeof(point_t), compare);
      |                                    ^~~~~~~
main.c:39:20: error: expected ';' before 'temp'
   39 |             point_t temp;
      |                    ^~~~~
      |                    ;
main.c:40:13: error: 'temp' undeclared (first use in this function)
   40 |             temp = aPoints[0];
      |             ^~~~
main.c:46:20: error: expected ';' before 'temp'
   46 |             point_t temp;
      |                    ^~~~~
      |                    ;
main.c:53:20: error: expected ';' before 'temp'
   53 |             point_t temp;
      |                    ^~~~~
      |                    ;
main.c:62:20: error: expected ';' before 'temp'
   62 |             point_t temp;
      |                    ^~~~~
      |                    ;
main.c:76:28: error: implicit declaration of function 'calloc' [-Wimplicit-function-declaration]
   76 |     ppHull = (point_ptr_t*)calloc(npoints, sizeof(int));
      |                            ^~~~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'calloc'
  +++ |+#include <stdlib.h>
    1 | #define MAX_INPUT 100000
main.c:76:28: warning: incompatible implicit declaration of built-in function 'calloc' [-Wbuiltin-declaration-mismatch]
   76 |     ppHull = (point_ptr_t*)calloc(npoints, sizeof(int));
      |                            ^~~~~~
main.c:76:28: note: include '<stdlib.h>' or provide a declaration of 'calloc'
main.c:79:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   79 |         printf("memory error");
      |         ^~~~~~
main.c:79:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:79:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:79:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:86:5: error: implicit declaration of function 'convex_hull' [-Wimplicit-function-declaration]
   86 |     convex_hull(aPoints, npoints, &ppHull, &hullsize);
      |     ^~~~~~~~~~~
main.c:88:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   88 |     printf("%d\n", hullsize);
      |     ^~~~~~
main.c:88:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:90:37: error: request for member 'x' in something not a structure or union
   90 |          printf("%d %d\n", ppHull[i]->x, ppHull[i]->y);
      |                                     ^~
main.c:90:51: error: request for member 'y' in something not a structure or union
   90 |          printf("%d %d\n", ppHull[i]->x, ppHull[i]->y);
      |                                                   ^~
main.c: In function 'compare':
main.c:102:5: error: unknown type name 'point_t'; use 'struct' keyword to refer to the type
  102 |     point_t t1 = *(point_t *)c1;
      |     ^~~~~~~
      |     struct 
main.c:102:20: error: 'point_t' undeclared (first use in this function)
  102 |     point_t t1 = *(point_t *)c1;
      |                    ^~~~~~~
main.c:102:29: error: expected expression before ')' token
  102 |     point_t t1 = *(point_t *)c1;
      |                             ^
main.c:103:12: error: expected ';' before 't2'
  103 |     point_t t2 = *(point_t *)c2;
      |            ^~~
      |            ;
main.c:105:10: error: request for member 'y' in something not a structure or union
  105 |     if(t1.y < t2.y){            /*y??§?¨???§?????????*/
      |          ^
main.c:105:15: error: 't2' undeclared (first use in this function); did you mean 't1'?
  105 |     if(t1.y < t2.y){            /*y??§?¨???§?????????*/
      |               ^~
      |               t1
main.c:107:16: error: request for member 'y' in something not a structure or union
  107 |     }else if(t1.y > t2.y){
      |                ^
main.c: At top level:
main.c:114:19: error: unknown type name 'point_t'; did you mean 'point_ptr_t'?
  114 | static double ccw(point_t* p1, point_t* p2, point_t* p3)
      |                   ^~~~~~~
      |                   point_ptr_t
main.c:114:32: error: unknown type name 'point_t'; did you mean 'point_ptr_t'?
  114 | static double ccw(point_t* p1, point_t* p2, point_t* p3)
      |                                ^~~~~~~
      |                                point_ptr_t
main.c:114:45: error: unknown type name 'point_t'; did you mean 'point_ptr_t'?
  114 | static double ccw(point_t* p1, point_t* p2, point_t* p3)
      |                                             ^~~~~~~
      |                                             point_ptr_t
main.c:122:18: error: unknown type name 'point_t'; did you mean 'point_ptr_t'?
  122 | void convex_hull(point_t* points, size_t npoints, point_ptr_t** out_hull, size_t* out_hullsize)
      |                  ^~~~~~~
      |                  point_ptr_t
main.c:122:35: error: unknown type name 'size_t'
  122 | void convex_hull(point_t* points, size_t npoints, point_ptr_t** out_hull, size_t* out_hullsize)
      |                                   ^~~~~~
main.c:122:35: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
main.c:122:75: error: unknown type name 'size_t'
  122 | void convex_hull(point_t* points, size_t npoints, point_ptr_t** out_hull, size_t* out_hullsize)
      |                                                                           ^~~~~~
main.c:122:75: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'