Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const ll mod = 1000000007;
const ll INF = mod * mod;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
typedef vector<int> vec;
typedef vector<string> svec;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
//#define int long long

set<int> s[800];
int a[800][800];
int n, cnt;

void solve() {
	cin >> n;
	cnt = (n + 1) / 2;
	rep(i, n + 1) {
		rep(j, n + 1) {
			a[i][j] = 0;
		}
	}
	if(n % 2 == 0) {
		for(int i = 0; i < n - 1; i++) {
			a[i][i + 1] = 1;
			a[i + 1][i] = 1;
		}
		a[0][n - 1] = 1;
		a[n - 1][0] = 1;
		for(int i = 2; i <= cnt - 1 ; i++) {
			int j = 0, k = 1, no = 0;
			while(true) {
				if(no > 2 * n) {
					break;
				}
				if(a[j][k] || k == 0) {
					k += 1;
			        k %= n;
					no ++;
				} else {
					a[j][k] = i;
					a[k][j] = i;
					k = j;
				}
			}

		}
		rep(i, n) {
			rep(j, n) {
				if(!a[i][j]) a[i][j] = cnt;
			}
		}

	} else {
		for(int i = 0; i < n - 2; i++) {
			a[i][i + 1] = 1;
			a[i + 1][i] = 1;
		}
		a[0][n - 2] = 1;
		a[n - 2][0] = 1;
		for(int i = 2; i <= cnt ; i++) {
			int j = 0, k = 1, no == 0;
			while() {
				if(no > 2 * n) {
					break;
				}
				if(a[j][k] || k == 0) {
					k += 1;
			        k %= n;
					no ++;
				} else {
					a[j][k] = i;
					a[k][j] = i;
					k = j;
				}
			}

		}
	}

	rep(i, n - 1) {
		for(int j = i + 1; j < n; j++) {
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//init();
	solve();
	//cout << "finish" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:100:46: error: expected initializer before '==' token
  100 |                         int j = 0, k = 1, no == 0;
      |                                              ^~
a.cc:101:31: error: expected primary-expression before ')' token
  101 |                         while() {
      |                               ^
a.cc:102:36: error: 'no' was not declared in this scope; did you mean 'n'?
  102 |                                 if(no > 2 * n) {
      |                                    ^~
      |                                    n
a.cc:108:41: error: 'no' was not declared in this scope; did you mean 'n'?
  108 |                                         no ++;
      |                                         ^~
      |                                         n