文章
71
粉丝
142
获赞
5
访问
52.9k
#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<cstdlib>
#include<ctime>
using namespace std;
const int maxn = 105;
int arr[maxn];
int record[1005];
int main() {
int n;
memset(record, 0, sizeof(record));
int j = 0;
for (int i = 0; i < n; i++) {
int num = rand() % 1000 + 1;
record[num]++;
if (record[num] == 1) {
arr[j++] = num;
}
}
cout << j << endl;
...
登录后发布评论
你这代码输入都没有啊。。。
注意看题目样例