明明的随机数(使用unordered_set和sort) 摘要:> unordered_set可以去重,但是不能用cin输入,要用**insert**> sort排序,默认升序。***unordered_set不能用sort***,先复制到vector中…… 题解列表 2025年02月21日 1 点赞 0 评论 62 浏览 评分:0.0
排序+去重 摘要:解题思路:注意事项:参考代码:#include<stdio.h>intmain(){ intnumber[100]; intn,…… 题解列表 2025年01月06日 1 点赞 0 评论 150 浏览 评分:0.0
1102: 明明的随机数 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;set<int>st;int main(){ int n,m; cin…… 题解列表 2024年11月08日 0 点赞 0 评论 154 浏览 评分:0.0
明明的随机数 摘要:```cpp include include include include using namespace std; const int N = 110; int n; in…… 题解列表 2024年11月03日 1 点赞 0 评论 165 浏览 评分:9.9
明明的随机数 摘要:解题思路:注意事项:参考代码:int main(){ //输入 int n = 0; scanf("%d", &n); //将每一个数字作为下标,将其对应的数组空间内置成数字的值 int input …… 题解列表 2024年08月22日 0 点赞 0 评论 149 浏览 评分:0.0
明明的随机数C++,使用vector函数 摘要:解题思路:利用vector容器设置数组先去重在排序,使用选择排序参考代码:#include<iostream>#include<vector>using namespace std;//选择排序voi…… 题解列表 2024年08月12日 0 点赞 0 评论 119 浏览 评分:0.0
1102: 明明的随机数 摘要:解题思路:题目描述:给定一个无序的整数序列,编写一个程序实现插入排序算法,对整数序列进行从小到大的排序,并输出排序后的整数个数和排序后的整数序列。输入格式:第一行输入一个整数N,表示整数序列的长度;接…… 题解列表 2024年07月12日 0 点赞 0 评论 177 浏览 评分:0.0
1102明明的随机数(冒泡排序解决) 摘要:解题思路:注意事项:参考代码:#include<iostream>using namespace std;int main(){ int n; cin >> n; int a[105]; for (i…… 题解列表 2024年06月04日 0 点赞 0 评论 107 浏览 评分:0.0
C++-使用动态数组,使用检查目标数组是否重复或检查原数组待输入值是否重发 摘要:解题思路: 排序:使用的普通的冒泡排序,其他的排序也可以无影响 去重: 思路1:检测目标数组是否存在与当前出原数组待输入项相等的值 思路2:检测原数组待输入项i与i-1项是否相等 注意事…… 题解列表 2024年06月01日 0 点赞 0 评论 91 浏览 评分:9.9
明明的随机数(简单解法) 摘要:解题思路:分为三步:第一步:得到数组数据第二步:去除重复的数字,用101表示第三步:把第一组去重后的数据放入第二组第四步:排序第五步:输出数组注意事项:参考代码:#include<iostream>u…… 题解列表 2024年05月11日 0 点赞 0 评论 207 浏览 评分:0.0