#include <bits/stdc++.h>
using namespace std;
int main()
{
cout << "Enter the length: " << endl;
int n;
cin >> n;
for (int i = 1; i <= 2 * n - 1; i++)
{
for (int j = 1; j <= 2 * n - 1; j++)
cout << ((j >= 1 + abs(i - n) && j <= 2 * n - 1 - abs(i - n)) ? "*" : " ");
cout << endl;
}
}
因篇幅问题不能全部显示,请点此查看更多更全内容