提交时间:2019-12-21 19:59:07
运行 ID: 3760
#include<iostream> using namespace std; int main(){ int n; char a[51][5]; cin>>n; for(int i=1;i<=n;i++){ for(int j=1;j<=50;j++){ cin>>a[i][j]; if(j%2==0){ int k=a[i][j]; a[i][j]=a[i][j-1]; a[i][j-1]=k; } if(a[i][j]=='/0'){ break; } } } for(int i=1;i<=n;i++){ for(int j=1;j<=50;j++){ cout<<a[i][j]; if(a[i][j]=='/0'){ break; } } cout<<endl; } return 0; }