#include <stdlib.h>
#include <stdio.h>
#include "a04-testing.h"

int print(int *a, int len) {
  for (int i = 0; i < len-1; i++) {
    printf("%d ", a[i]);
  }
  printf("%d", a[len-1]);
  putchar('\n');
}

int main(int argc, char *argv[]) {
  int len = argc - 1; if (argc < 1) return recSort(0, 0, 0);
  int *a = malloc(sizeof(int) * (len + 1));
  for (int i = 0; i < len; i++) {
    a[i] = atoi(argv[i+1]);
  }
  print(a, len);
  printf("%d\n", recSort(a, a+len, 0));
  print(a, len);
  free(a);
  return 1;
}
