题目1464:Hello World for U
/*题目1464:Hello World for U*/
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{
freopen("in.in", "r", stdin);
freopen("out.out","w", stdout);
//输入部分
char input[81];
while(cin >> input)
{
string s = input;
int len = s.length();
//计算部分
int n1,n2, n3,i,j;
n1 = n3 =(len + 2) / 3 -1;
n2 = len - n1 - n3;
string left,right, bottom;
left = s.substr(0,n1);
right = s.substr(len-n3,n3);
bottom = s.substr(n1,n2);
reverse(right.begin(),right.end());
for (i=0; i<n1; i++)
{
cout << left[i];
for (j=0; j<n2-2; j++)
cout << " ";
cout << right[i] << endl;
}
cout << bottom << endl;
}
return 0;
}