【算法代码】
#include <bits/stdc++.h>
using namespace std;
const int maxn=105;
int n;
struct node {
int v,id;
} p[maxn];
bool cmp(node x,node y) {
if(x.v!=y.v) return x.v<y.v;
return x.id<y.id;
}
int main() {
scanf("%d%d",&n);
for(int i=1; i<=n; i++) {
scanf("%d",&p[i].v);
p[i].id=i;
}
sort(p+1,p+1+n,cmp);
for(int i=1; i<=n; i++) {
cout<<p[i].id<<" ";
}
return 0;
}
/*
in:
4 4
3 8 2 6
out:
3 1 4 2
*/