题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2562
方法:无
思路:超级大水题,直接按要求做就行,在此知识记录一下代码。
难点:无
#include<iostream>
#include<cstdio>
#include<string.h>
using namespace std;
int main()
{
int t;
char str[100];
while(cin>>t)
{
while(t--)
{
scanf("%s",&str);
int l = strlen(str);
for(int i = 0;i <= l;i = i+2)
{
char t;
t = str[i];
str[i] = str[i+1];
str[i+1] = t;
}
printf("%s\n",str);
}
}
}