Language: C++

//#include "pch.h"
#include <iostream>
#include <algorithm>
#include <vector>
#include<string>
#include <set>
#include <map>
#include <queue>
#include <limits.h>
#include <bitset>
#include <cmath>

using namespace std;

#define rip(i, n, s) for (int i = (s);i < ( int )( n ); i++)
#define all(a) (a).begin(), (a).end()
typedef long long ll;

long long pow(long long n, long long p, long long k) {//n^k(mod p)
	if (k != 0) {
		if (p % 2 == 0) {
			long long x = pow(n, p, k / 2);
			return (long long)x*x%p;
		}
		else {
			long long x = pow(n, p, k - 1);
			return (long long)x*n%p;
		}
	}
	return 1;
}
long long rev(long long n, long long p) {//nの逆元
	return pow(n, p, p - 2);
}
long long bino(long long n, long long m, long long p) {//nCm(mod p)
	long long me = 1;
	long long ans = 1;
	for (int i = 0;i < n + m;i++) {
		me = (long long)(i + 1) * ans % p;
		if (i == m - 1) {
			ans = (long long)rev(me, p) * ans%p;
		}
		if (i == m - n - 1) {
			ans = (long long)(rev(me, p))*ans%p;
		}
	}
	ans = (long long)(ans*me%p);
	return ans;
}
struct modint {
	long long num;
	long long p;
	modint() {
		num = 0;
		p = 998244353;
	}
	modint(int x) {
		p = 998244353;
		num = (long long)x%p;
	}
	modint(long long x) {
		p = 998244353;
		num = x % p;
	}
	modint operator+(const modint &other) {
		modint ret;
		ret.p = p;
		ret.num = (num + other.num) % p;
		return ret;
	}
	modint operator+(const long long &other) {
		modint ret;
		ret.p = p;
		ret.num = (num + (other%p)) % p;
		return ret;
	}
	modint operator-(const modint &other) {
		modint ret;
		ret.p = p;
		ret.num = (num - other.num + p) % p;
		return ret;
	}
	modint operator-(const long long &other) {
		modint ret;
		ret.p = p;
		ret.num = (num - (other%p) + p) % p;
		return ret;
	}
	modint operator*(const modint &other) {
		modint ret;
		ret.p = p;
		ret.num = (num*other.num) % p;
		return ret;
	}
	modint operator*(const long long &other) {
		modint ret;
		ret.p = p;
		ret.num = (num*(other%p)) % p;
		return ret;
	}
	modint operator/(const modint &other) {
		modint ret;
		ret.p = p;
		ret.num = (num*rev(other.num, p)) % p;
		return ret;
	}
	modint operator/(const long long &other) {
		modint ret;
		ret.p = p;
		ret.num = (num*rev(other%p, p)) % p;
		return ret;
	}
	void operator+=(const long long &other) {
		num = (num + other) % p;
	}
	void operator+=(const modint &other) {
		num = (num + other.num) % p;
	}
	void operator-=(const long long &other) {
		num = (num - other + p) % p;
	}
	void operator-=(const modint &other) {
		num = (num - other.num + p) % p;
	}
	void operator*=(const long long &other) {
		num = (num*other) % p;
	}
	void operator*=(const modint &other) {
		num = (num*other.num) % p;
	}
};

int main() {
	int n;
	cin >> n;
	vector<ll> da(n);
	rip(i, n, 0) {
		cin >> da[i];
	}
	modint ans;
	rip(i, n, 0) {
		ans += da[i];
	}
	ans = ans * ans;
	vector<bool> prime(1000, true);
	prime[0] = false;prime[1] = false;
	rip(i, 1000, 2) {
		int no = i * 2;
		while (no < 1000) {
			prime[no] = false;
			no *= i;
		}
	}
	rip(i, 1000, 0) {
		if (prime[i]) {
			int co = 0;
          modint now=0
			while (true) {
				rip(j, n, 0) {
					if (da[j] % i == 0) {
						da[j] /= i;
						co++;
					}
				}
				if (co > 1) {
					ans -= co * co*i*i;
					co = 0;
				}
				else {
					break;
				}
			}
		}
	}
	rip(i, n, 0) {
		ans -= da[i] * da[i];
	}
	ans = ans / 2;
	cout << ans.num << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:158:25: error: expected ',' or ';' before 'while'
  158 |                         while (true) {
      |                         ^~~~~