测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A62499. 阅读C++程序填写结果:#include<bits/stdc++.h>

编程题

题目描述

阅读C++程序填写结果:

#include<bits/stdc++.h>
using namespace std;
const int maxn=100 + 7;
int p1[maxn],p2[maxn];
int main()
{
    int n; scanf("%d",&n);
    for(int i= 1;i<= n; ++i){
        scanf("%d",&p1[i]);
    }
    for(int i =1; i <= n; ++i){
        p2[i]= p1[p1[i]];
    }
    for(int i=1;i<= n; ++i){
        cout<<p2[i]<<" ";
    } 
cout<<"\n";
return 0;
}