您的位置:首页 > 其它

1031. Hello World for U (20)

2015-06-20 09:39 344 查看
#define _CRT_SECURE_NO_WARNINGS

#include<string>

#include<string.h>

#include<vector>

#include<queue>

#include<iostream>

#include<algorithm>

#include<stdio.h>

using namespace std;

int main()

{

string s;

cin >> s;

int x1 = (s.size() + 2) / 3;

int x3 = x1;

int x2 = x1 + (s.size() + 2) % 3;

for (int i = 0; i < x1 - 1; i++)

{

cout << s[i];

for (int j = 0; j < x2 - 2; j++)

cout << " ";

cout << s[s.size()-i-1]<<endl;

}

for (int i = 0; i < x2; i++)

cout << s[x1 - 1 + i];

cout << endl;

return 0;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: