text: // https://codecast.france-ioi.org/v6/player?stepperControls=_undo,_redo,_expr,_out,_over&base=https%3A%2F%2Ffioi-recordings.s3.amazonaws.com%2Fdartmouth%2F1521218957823
  
  #include <stdio.h>
  #include <stdlib.h>
  struct point {
    int x;
    int y;
  };
  void printPoint(struct point pt);
  void readPoint(struct point *ptr);
  void printPoly(struct point *ptr, int vertices);
  int main(void) {
    //! showMemory(start=65520)
    struct point *polygon;
    int i, num;
    printf("How many vertices does your polygon have? ");
    scanf("%d", &num);
    polygon = (struct point *)malloc(num * sizeof(struct point));
    for (i = 0; i < num; i++) {
      readPoint(&polygon[i]);
    }
    printPoly(polygon, num);
    free(polygon);
    return 0;
  }
  
  void readPoint(struct point *ptr) {
    printf("\nEnter a new point: \n");
    printf("x-coordinate: ");
    scanf("%d", &ptr->x);
    printf("y-coordinate: ");
    scanf("%d", &ptr->y);
  }
  
  void printPoly(struct point *ptr, int vertices) {
    int i;
    for (i = 0; i < vertices; i++) {
      printPoint(ptr[i]);
    }
  }
  
  void printPoint(struct point pt) { printf("(%d, %d)\n", pt.x, pt.y); }