提交时间:2019-12-24 18:21:55

运行 ID: 3860

#include <stdio.h> #include <string.h> int main(){ int T; char s[51]; int length; char temp; int i; scanf("%d",&T); while(T--){ scanf("%s",s); length=strlen(s); for(i=0;i<length-1;i+=2){ temp=s[i]; s[i]=s[i+1]; s[i+1]=temp; } printf("%s\n",s); } return 0; }