0011:Drawing Lots
#include<iostream> #include<algorithm> using namespace std; int main(void){ int x,y,a,b,n[31]; char s; cin >> y >> x; for(int i=1; i<=y; i++)n[i]=i; for(int i=0; i<x; i++){ cin >> a >> s >> b; swap(n[a],n[b]); } for(int i=1; i<=y; i++)cout << n[i] << endl; return 0; }