#include <iostream> #include<cmath> #include "algorithm" #include "cstdio" #include "stack" using namespace std; bool cmp(const int a, const int b) { return a<b; } int main() { int n; cin >> n; int a[n];
1.定义一个一维数,数组大小为24. 2.产生0~23的随机数. 3.将产生的随机数存入i数组,要求数组中的每个数据不能相同. 4.补充说明,这个子程序要求每次调用后,这个数组里面就 存放了0~23这些数据,而且这些数据没有重复的. 5.注意,C语言有随机数函数,可以用函数产生随机数.RAND(N) #include <stdio.h>#include <time.h>#define ArrayMaxItem 24 int RandTest(){ int i = 0; int re