Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
3860 | 李言 | 奇偶位互换 | C++ | 通过 | 100 | 0 MS | 188 KB | 429 | 2019-12-24 18:21:55 |
#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; }