当前位置:网站首页>Returns the subscript after array sorting
Returns the subscript after array sorting
2022-04-23 14:14:00 【Stingy old Sao】
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
using namespace std;
int a[3]={3,1,2};
bool cmp(int i,int j){
return a[i]<a[j];
}
int main()
{
int b[3];
iota(b,b+3,0);
sort(b,b+3,cmp);
for (int x:b) {
cout<<x<<" ";
}
cout<<endl;
return 0;
}
版权声明
本文为[Stingy old Sao]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231407093612.html
边栏推荐
猜你喜欢
logback-logger和root
sql中出现一个变态问题
01-nio basic ByteBuffer and filechannel
政务云迁移实践 北明数科使用HyperMotion云迁移产品为某政府单位实施上云迁移项目,15天内完成近百套主机迁移
Storage path of mod subscribed by starbound Creative Workshop at Star boundary
MYSQL 主从同步避坑版教程
使用itextpdf实现截取pdf文档第几页到第几页,进行分片
使用Executors类快速创建线程池
Jmeter设置环境变量支持在任意终端目录输入jmeter直接启动
按实际取,每三级分类汇总一次,看图知需求
随机推荐
如何轻松做好一个项目
MySQL数据库讲解(九)
DeepinV20安装Mariadb
政务云迁移实践 北明数科使用HyperMotion云迁移产品为某政府单位实施上云迁移项目,15天内完成近百套主机迁移
星界边境文本自动翻译机使用说明
快速搞懂线程实现的三种方式
Use of WiFi module based on wechat applet
Jira截取全图
MySQL数据库讲解(八)
Wechat applet communicates with esp8266 based on UDP protocol
使用Executors类快速创建线程池
Some good articles on pthread multithreading
利用json-server在本地创建服务器请求
帆软之单元格部分字体变颜色
Switch usage (wechat applet)
Subscription number development of wechat applet (message push)
Win10 comes with groove music, which can't play cue and ape files. It's a curvilinear way to save the country. It creates its own aimpack plug-in package, and aimp installs DSP plug-in
关于云容灾,你需要知道这些
Postman的安装使用及填坑心得
RecyclerView细节研究-RecyclerView点击错位问题的探讨与修复