#include<cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int n;
cin >> n;
int cx = n / 2, cy = n / 2;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
if (abs(cx - i) + abs(cy - j) <= n / 2)
cout << '*';
else cout << ' ';
cout << endl;
}
return 0;
}
奇数输入菱形
于 2023-12-07 21:30:54 首次发布