#include <iostream>
void foo(int n)
{
using std::cout;
using std::exception;
if (n <= 3 || (n & 1) == 0) throw new exception();
for (size_t i = 0; i < n; ++i)
{
for (size_t j = 0; j < n; ++j)
{
(i == j || i + j == n - 1 || i == (n - 1) / 2 || j == (n - 1) / 2) ?
cout << " * " :
cout << " ";
}
cout << '\n';
}
}
int main()
{
foo(7);
}