原题http://codeforces.com/contest/136/problem/A
这道题拿例一来说
Input
4
2 3 4 1(对其编号从1-4)
对2 3 4 1从大到小排序, 排序完之后是1 2 3 4它们的原编号是4 1 2 3。
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int hash[100];
int main()
{
int n;
int a[100];
while(scanf("%d",&n)!=EOF)
{
memset(hash,0,sizeof(hash));
for(int i=0;i<n;i++)
{
scanf("%d",&a[i]);
hash[a[i]]=i;
}
sort(a,a+n);
for(int i=0;i<n;i++)
{
if(i!=n-1)
printf("%d ",hash[a[i]]+1);
else
printf("%d\n",hash[a[i]]+1);
}
}
return 0;
}