一,理解思路 产生所需范围随机数。 取其中n个随机数,去除重复随机数。 排序输出。 二,代码演示 #define _CRT_SECURE_NO_WARNINGS 1 #include <stdio.h> #include <stdlib.h> #include <math.h> #include <time.h> int comp_int(const void* e1, const void* e2) { return *(char*)e1 - *(char*)e2; } int