您的位置:首页 > 其它

HDOJ  2562   奇偶位互换

2015-12-18 18:08 274 查看
题目:http://acm.hdu.edu.cn/showproblem.php?pid=2562

#include <iostream>

#include <algorithm>

using namespace std;

int main()

{

int T;

char
temp;

string
s;


cin>>T;


while(T--)

{


cin>>s;


for(int i=0;i<s.length();i+=2)


{


temp=s[i+1];


s[i+1]=s[i];


s[i]=temp;


}


cout<<s<<endl;

}

return
0;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: