Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
148882 潘明泽 奇偶位互换 C++ Runtime Error 0 MS 272 KB 501 2026-03-01 20:04:35

Tests(0/1):


Code:

#include<bits/stdc++.h> using namespace std; string s1,s2,s3; int n,f1,f2; int g; int main(){ cin>>g; cin.get(); for(int j=1;j<=g;j++){ cin>>s1; n=s1.size(); for(int i=0;i<n;i+=2){ s2[i/2]=s1[i]; } for(int j=1;j<n;j+=2){ s3[(j-1)/2]=s1[j]; } for(int i=0;i<n/2;i++){ cout<<s3[i]<<s2[i]; } s1=""; s2=""; s3=""; } return 0; }


Run Info:

Runtime Error:Segmentation fault