C++ 代码
#include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
int len = s.size();
for( int i = 0 ; i < (len+2)/3-1 ; i++){
cout<<s[i];
for( int j = 0 ; j<len+2-(len+2)/3-(len+2)/3 -2 ; j++) cout<<" ";
cout<<s[len-i-1]<<endl;
}
for(int i = 0 ;i<len+2-(len+2)/3-(len+2)/3 ; i++){
cout<<s[(len+2)/3+i-1];
}
return 0;
}