do{ cout<<m[1]<<' '<<m[2]<<' '<<m[3]<<endl; }while(next_permutation(m,m+3));
do{ cout<<m<<endl; }while(next_permutation(m.begin(),m.end());