测试感觉溢出了?还是没反应?
#include<iostream>
using namespace std;
int main(){
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
int a_len;
cin>>a_len;
int a1,a2,gg[4];
gg[1]=1,gg[2]=2,gg[3]=3;
while(cin>>a1>>a2){
swap(gg[a1],gg[a2]);
}
cout<<gg[a_len];
//fclose(stdin);
//fclose(stdout);
return 0;
}