//设置排序规则
auto comp = [&nums](const int &a, const int &b) {
if(nums[a]<nums[b]) return true;
else return false;
};
//设置下标0,1,2,3...
vector<size_t> idx(nums.size());
iota(idx.begin(), idx.end(), 0);
//输出下标
for(auto &w:idx) {
cout<<w<<endl;
}
//按规则排序
sort(idx.begin(),idx.end(),comp);
//输出排序后的下标
for(auto &w:idx) {
cout<<w<<endl;
}