fork download
  1. #include <stdio.h>
  2. int main(){
  3. int n;
  4. scanf("%d",&n);
  5. int a[1000];
  6. for(int i=0;i<n;i++){
  7. scanf("%d",&a[i]);
  8. }
  9.  
  10. for(int i=0;i<n;i++){
  11. int temp=a[i];
  12. printf("%d\n",a[temp]);
  13. }
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0.01s 5320KB
stdin
6
1 2 0 5 3 4
stdout
2
0
1
4
5
3