1027

// PATn.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"
#include
#include
#include

using namespace std;

int main()
{
    unsigned n;
    string c;
    cin >> n >> c;

    int ret = (n+1)/2;
    int max = 1;
    int sum = 0;

    while (ret>=1)
    {
        sum = sum + max;
        ret = ret - max;
        max = max + 2;
        if (max > ret)
            break;
    }
    max = max - 2;



    cout.flags(ios::right);
    for (int j = max; j > 0; j = j - 2)
    {
        cout.fill(' ');
        if(max==j)
            cout << setw((max - j) / 2) << "";
        else
            cout << setw((max - j)/2)<<" ";
        cout.fill(c[0]);
        cout << setw(j)<=7)
    {
        for (int j = 3; j <= max; j = j + 2)
        {
            cout.fill(' ');
            if (max == j)
                cout << setw((max - j) / 2) << "";
            else
                cout << setw((max - j) / 2) << " ";
            cout.fill(c[0]);
            cout << setw(j)<

你可能感兴趣的:(1027)