当前位置:网站首页>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
边栏推荐
- Promtail + Loki + Grafana 日志监控系统搭建
- 快速搞懂线程实现的三种方式
- Pycharm连接远程服务器并实现远程调试
- Some good articles on pthread multithreading
- 帆软实现一个单选按钮,可以统一设置其他单选按钮的选择状态
- ThreadGroup ThreadGroup implémente l'interface threadfactory en utilisant la classe Introduction + Custom thread Factory
- squid代理
- Jmeter设置环境变量支持在任意终端目录输入jmeter直接启动
- void*是怎样的存在?
- 服务器日志分析工具(识别,提取,合并,统计异常信息)
猜你喜欢
Use of WiFi module based on wechat applet
Indoor and outdoor map switching (indoor three-point positioning based on ibeacons)
云迁移的六大场景
星界边境文本自动翻译机使用说明
正则表达式
01-nio basic ByteBuffer and filechannel
帆软实现一个单选按钮,可以统一设置其他单选按钮的选择状态
关于云容灾,你需要知道这些
Wechat applet positioning and ranging through low-power Bluetooth device (2)
squid代理
随机推荐
使用itextpdf实现截取pdf文档第几页到第几页,进行分片
RobotFramework 之 项目框架
RecyclerView细节研究-RecyclerView点击错位问题的探讨与修复
ThreadGroup ThreadGroup implémente l'interface threadfactory en utilisant la classe Introduction + Custom thread Factory
MySQL lock database lock
JSP学习2
帆软实现分页时第一行和最后两行冻结方式
dp-能量项链
如何轻松做好一个项目
MySQL数据库讲解(十)
json date时间日期格式化
ActiveMq基础知识
squid代理
帆软之单元格部分字体变颜色
FBS (fman build system) packaging
Jacob print word
MySQL数据库讲解(九)
VMware installation 64 bit XP Chinese tutorial
Redis数据库讲解(一)
Wechat applet communicates with esp8266 based on UDP protocol