Language: C++

#define _USE_MATH_DEFINES
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<list>
#include<stack>
#include<queue>
#include<cctype>
#include<iomanip>
#include<functional>
#include<numeric>
#include<map>
#include<set>
#define EPS 1e-10
using namespace std;
typedef long long llong;
int main() {
	int n;
	while (cin >> n&&n) {
		vector<vector<int >???>v(n, vector<int>(n));
		for (int i = 0; i < n; i++)for (int j = 0; j < n; j++)v[i][j] = -1;
		v[n / 2 + 1][n / 2] = 1;
		pair<int, int>pp;
		pp.first = n / 2 + 1;
		pp.second = n / 2;
		int cnt = 1;
		pair<int, int>pn;
		pn.first = pp.first + 1;
		pn.second = pp.second + 1;
		while (cnt < n*n) {
			if (pn.second == n) {
				pn.second = 0;
				//cout << "right" << endl;
			}
			if (pn.second == -1) {
				pn.second = n - 1;
				//cout << "left" << endl;
			}
			if (pn.first == n) {
				pn.first = 0;
				//cout << "under" << endl;
			}

			if (v[pn.first][pn.second] != -1) {
				pn.first++;
				pn.second--;
				//cout << "full" << endl;
			}
			else {
				cnt++;
				v[pn.first][pn.second] = cnt;
				pn.first++;
				pn.second++;
				//cout << "success" << endl;
			}
		}
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < n; j++) {
				printf("%4d", v[i][j]);
			}
			putchar('\n');
		}
	}
	return 0;
}

Compiler output:
a.cc:23:37: warning: trigraph ??> ignored, use -trigraphs to enable [-Wtrigraphs]
   23 |                 vector<vector<int >???>v(n, vector<int>(n));
a.cc: In function 'int main()':
a.cc:23:39: error: template argument 1 is invalid
   23 |                 vector<vector<int >???>v(n, vector<int>(n));
      |                                       ^
a.cc:23:39: error: template argument 2 is invalid
a.cc:23:59: error: expression list treated as compound expression in initializer [-fpermissive]
   23 |                 vector<vector<int >???>v(n, vector<int>(n));
      |                                                           ^
a.cc:23:45: error: cannot convert 'std::vector<int>' to 'int' in initialization
   23 |                 vector<vector<int >???>v(n, vector<int>(n));
      |                                             ^~~~~~~~~~~~~~
      |                                             |
      |                                             std::vector<int>
a.cc:24:72: error: invalid types 'int[int]' for array subscript
   24 |                 for (int i = 0; i < n; i++)for (int j = 0; j < n; j++)v[i][j] = -1;
      |                                                                        ^
a.cc:25:18: error: invalid types 'int[int]' for array subscript
   25 |                 v[n / 2 + 1][n / 2] = 1;
      |                  ^
a.cc:47:30: error: invalid types 'int[int]' for array subscript
   47 |                         if (v[pn.first][pn.second] != -1) {
      |                              ^
a.cc:54:34: error: invalid types 'int[int]' for array subscript
   54 |                                 v[pn.first][pn.second] = cnt;
      |                                  ^
a.cc:62:48: error: invalid types 'int[int]' for array subscript
   62 |                                 printf("%4d", v[i][j]);
      |                                                ^