# Include
# Include
# Include
# Define max_num100 # define SWAP (X, Y, TEMP) (TEMP = X), (X = Y), (Y = TEMP) // flexible Recursive Algorithms
void perm(int *list, int i, int n){int j, temp;if (i == (n - 1)) {for (j = 0; j < n; j++) {printf("%d ", list[j]);}printf("\n");} else {for (j = i; j < n; j++) {SWAP(list[i], list[j], temp);perm(list, i + 1, n);SWAP(list[i], list[j], temp);}} }int main(int argc, char *argv[]){int list[max_num];int i, j, num, min, temp;printf("Please input number:");scanf("%d", &num);if (num < 0 || num > max_num) {fprintf(stderr, "invalid data\n");exit(1);}for (i = 0; i < num; i++) {list[i] = rand() % 1000;printf("%d ", list[i]);}printf("\n");for (i = 0; i < num; i++) {min = i;for (j = i + 1; j < num; j ++) {if (list[j] < list[min])min = j;}SWAP(list[i], list[min], temp);}printf("After select sort result:\n");for (i = 0; i < num; i ++)printf("%d ", list[i]);printf("\n\n\n");perm(list, 0, num);}