Run ID:100349
提交时间:2024-12-07 16:10:53
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,man1,man2; cin>>n; int a[n]; int s[100]={0}; for(int z=0;z<n;z++){ cin>>a[z]; } for(int z=0;z<n;z++){ man1=a[z]; man2=a[man1-1]; s[z]=a[man2-1]; } for(int z=0;z<n;z++){ cout<<s[z]<<" "; } return 0; }