#include #include // Capture the pipe of array contents, first number is the size int main() { int s; scanf("%d", &s); int *array = malloc(sizeof(int) * s); for (int i = 0; i < s; i++) { scanf("%d", &array[i]); } for (int j = 1; j < s; j++) { int key = array[j]; int i = j - 1; while (i >= 0 && array[i] > key) { array[i + 1] = array[i]; i -= 1; } array[i + 1] = key; } free(array); return 0; }