竞赛
考级
法兰西玫瑰
#include <iostream> #include <string> using namespace std; int main() { string s; string s1,s2; cin>>s; for(int i=0;i<s.size();i++) { if(i%2==0) { s1=s1+s[i]; } else { s2=s2+s[i]; } } cout<<s2<<s1; return 0; }
chaizechen
#include<iostream> using namespace std; int main(){ string s,s1="",s2=""; cin>>s; for(int i=0;i<s.size();i++){ if(i%2==0){ s1=s1+s[i]; }else{ s2=s2+s[i]; } } if(s1<s2){ s2=s2+s1; cout<<s2; }else{ s1=s1+s2; cout<<s1; } }
ZDZL_.(714)
#include <bits/stdc++.h> using namespace std; int main(){ string s,s1="",s2=""; cin>>s; for(int i=0;i<s.size();i++) if(i%2==0) s2+=s[i]; else s1+=s[i]; if(s1>s2) { s1+=s2; cout<<s1<<endl; } else { s2+=s1; cout<<s2<<endl; } }
Voldemort
Eren.
嫌疑を避ける ~~
……
i am the best™半退
JMZ詹总
准
手持剑,刺锋芒
耐高总冠军 张文杰
#include <iostream> using namespace std; int main(){ string a,b,c; cin>>a; for(int i=0;i<a.size();i++){ if(i%2==0){ b+=a[i]; }else{ c+=a[i]; } } if(b>c){ b+=c; cout<<b; } else { c+=b; cout<<c; } return 0; }
烈火麒麟