Language: C++

#include <iostream>
using namespace std;
void trace(int A[], int N) {
????????int i;
????????for (i = 0; i < N; i++) {
????????????????if (i > 0)?? cout << " ";
????????????????cout << A[i];
????????}
????????cout << endl;
}
void insertSort(int A[], int N) {
????????int j, i, v;
????????for (i = 1; i < N; i++) {
????????????????v = A[i];
????????????????j = i - 1;
????????????????while (j >= 0 && A[j] > v) {
????????????????????????A[j + 1] = A[j];
????????????????????????j--;
????????????????}
????????????????A[j + 1] = v;
????????????????trace(A, N);
????????}
}
int main() {
????????int N, i, j;
????????int A[100];
????????cin >> N;
????????for (i = 0; i < N; i++)
????????????????cin >> A[i];
????????trace(A, N);
????????insertSort(A, N);
????????return 0;
}

Compiler output:
a.cc: In function 'void trace(int*, int)':
a.cc:4:1: error: expected primary-expression before '?' token
    4 | ????????int i;
      | ^
a.cc:4:2: error: expected primary-expression before '?' token
    4 | ????????int i;
      |  ^
a.cc:4:3: error: expected primary-expression before '?' token
    4 | ????????int i;
      |   ^
a.cc:4:4: error: expected primary-expression before '?' token
    4 | ????????int i;
      |    ^
a.cc:4:5: error: expected primary-expression before '?' token
    4 | ????????int i;
      |     ^
a.cc:4:6: error: expected primary-expression before '?' token
    4 | ????????int i;
      |      ^
a.cc:4:7: error: expected primary-expression before '?' token
    4 | ????????int i;
      |       ^
a.cc:4:8: error: expected primary-expression before '?' token
    4 | ????????int i;
      |        ^
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int i;
      |         ^~~
a.cc:4:9: error: expected ':' before 'int'
    4 | ????????int i;
      |         ^~~
      |         :
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int i;
      |         ^~~
a.cc:4:9: error: expected ':' before 'int'
    4 | ????????int i;
      |         ^~~
      |         :
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int i;
      |         ^~~
a.cc:4:9: error: expected ':' before 'int'
    4 | ????????int i;
      |         ^~~
      |         :
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int i;
      |         ^~~
a.cc:4:9: error: expected ':' before 'int'
    4 | ????????int i;
      |         ^~~
      |         :
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int i;
      |         ^~~
a.cc:4:9: error: expected ':' before 'int'
    4 | ????????int i;
      |         ^~~
      |         :
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int i;
      |         ^~~
a.cc:4:9: error: expected ':' before 'int'
    4 | ????????int i;
      |         ^~~
      |         :
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int i;
      |         ^~~
a.cc:4:9: error: expected ':' before 'int'
    4 | ????????int i;
      |         ^~~
      |         :
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int i;
      |         ^~~
a.cc:4:9: error: expected ':' before 'int'
    4 | ????????int i;
      |         ^~~
      |         :
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int i;
      |         ^~~
a.cc:5:1: error: expected primary-expression before '?' token
    5 | ????????for (i = 0; i < N; i++) {
      | ^
a.cc:5:2: error: expected primary-expression before '?' token
    5 | ????????for (i = 0; i < N; i++) {
      |  ^
a.cc:5:3: error: expected primary-expression before '?' token
    5 | ????????for (i = 0; i < N; i++) {
      |   ^
a.cc:5:4: error: expected primary-expression before '?' token
    5 | ????????for (i = 0; i < N; i++) {
      |    ^
a.cc:5:5: error: expected primary-expression before '?' token
    5 | ????????for (i = 0; i < N; i++) {
      |     ^
a.cc:5:6: error: expected primary-expression before '?' token
    5 | ????????for (i = 0; i < N; i++) {
      |      ^
a.cc:5:7: error: expected primary-expression before '?' token
    5 | ????????for (i = 0; i < N; i++) {
      |       ^
a.cc:5:8: error: expected primary-expression before '?' token
    5 | ????????for (i = 0; i < N; i++) {
      |        ^
a.cc:5:9: error: expected primary-expression before 'for'
    5 | ????????for (i = 0; i < N; i++) {
      |         ^~~
a.cc:5:9: error: expected ':' before 'for'
    5 | ????????for (i = 0; i < N; i++) {
      |         ^~~
      |         :
a.cc:5:9: error: expected primary-expression before 'for'
    5 | ????????for (i = 0; i < N; i++) {
      |         ^~~
a.cc:5:9: error: expected ':' before 'for'
    5 | ????????for (i = 0; i < N; i++) {
      |         ^~~
      |         :
a.cc:5:9: error: expected primary-expression before 'for'
    5 | ????????for (i = 0; i < N; i++) {
      |         ^~~
a.cc:5:9: error: expected ':' before 'for'
    5 | ????????for (i = 0; i < N; i++) {
      |         ^~~
      |         :
a.cc:5:9: error: expected primary-expression before 'for'
    5 | ????????for (i = 0; i < N; i++) {
      |         ^~~
a.cc:5:9: error: expected ':' before 'for'
    5 | ????????for (i = 0; i < N; i++) {
      |         ^~~
      |         :
a.cc:5:9: error: expected primary-expression before 'for'
    5 | ????????for (i = 0; i < N; i++) {
      |         ^~~
a.cc:5:9: error: expected ':' before 'for'
    5 | ????????for (i = 0; i < N; i++) {
      |         ^~~
      |         :
a.cc:5:9: error: expected primary-expression before 'for'
    5 | ????????for (i = 0; i < N; i++) {
      |         ^~~
a.cc:5:9: error: expected ':' before 'for'
    5 | ????????for (i = 0; i < N; i++) {
      |         ^~~
      |         :
a.cc:5:9: error: expected primary-expression before 'for'
    5 | ????????for (i = 0; i < N; i++) {
      |         ^~~
a.cc:5:9: error: expected ':' before 'for'
    5 | ????????for (i = 0; i < N; i++) {
      |         ^~~
      |         :
a.cc:5:9: error: expected primary-expression before 'for'
    5 | ????????for (i = 0; i < N; i++) {
      |         ^~~
a.cc:5:9: error: expected ':' before 'for'
    5 | ????????for (i = 0; i < N; i++) {
      |         ^~~
      |         :
a.cc:5:9: error: expected primary-expression before 'for'
    5 | ????????for (i = 0; i < N; i++) {
      |         ^~~
a.cc:5:21: error: 'i' was not declared in this scope
    5 | ????????for (i = 0; i < N; i++) {
      |                     ^
a.cc:9:1: error: expected primary-expression before '?' token
    9 | ????????cout << endl;
      | ^
a.cc:9:2: error: expected primary-expression before '?' token
    9 | ????????cout << endl;
      |  ^
a.cc:9:3: error: expected primary-expression before '?' token
    9 | ????????cout << endl;
      |   ^
a.cc:9:4: error: expected primary-expression before '?' token
    9 | ????????cout << endl;
      |    ^
a.cc:9:5: error: expected primary-expression before '?' token
    9 | ????????cout << endl;
      |     ^
a.cc:9:6: error: expected primary-expression before '?' token
    9 | ????????cout << endl;
      |      ^
a.cc:9:7: error: expected primary-expression before '?' token
    9 | ????????cout << endl;
      |       ^
a.cc:9:8: error: expected primary-expression before '?' token
    9 | ????????cout << endl;
      |        ^
a.cc:9:21: error: expected ':' before ';' token
    9 | ????????cout << endl;
      |                     ^
      |                     :
a.cc:9:21: error: expected primary-expression before ';' token
a.cc:9:21: error: expected ':' before ';' token
    9 | ????????cout << endl;
      |                     ^
      |                     :
a.cc:9:21: error: expected primary-expression before ';' token
a.cc:9:21: error: expected ':' before ';' token
    9 | ????????cout << endl;
      |                     ^
      |                     :
a.cc:9:21: error: expected primary-expression before ';' token
a.cc:9:21: error: expected ':' before ';' token
    9 | ????????cout << endl;
      |                     ^
      |                     :
a.cc:9:21: error: expected primary-expression before ';' token
a.cc:9:21: error: expected ':' before ';' token
    9 | ????????cout << endl;
      |                     ^
      |                     :
a.cc:9:21: error: expected primary-expression before ';' token
a.cc:9:21: error: expected ':' before ';' token
    9 | ????????cout << endl;
      |                     ^
      |                     :
a.cc:9:21: error: expected primary-expression before ';' token
a.cc:9:21: error: expected ':' before ';' token
    9 | ????????cout << endl;
      |                     ^
      |                     :
a.cc:9:21: error: expected primary-expression before ';' token
a.cc:9:21: error: expected ':' before ';' token
    9 | ????????cout << endl;
      |                     ^
      |                     :
a.cc:9:21: error: expected primary-expression before ';' token
a.cc: In function 'void insertSort(int*, int)':
a.cc:12:1: error: expected primary-expression before '?' token
   12 | ????????int j, i, v;
      | ^
a.cc:12:2: error: expected primary-expression before '?' token
   12 | ????????int j, i, v;
      |  ^
a.cc:12:3: error: expected primary-expression before '?' token
   12 | ????????int j, i, v;
      |   ^
a.cc:12:4: error: expected primary-expression before '?' token
   12 | ????????int j, i, v;
      |    ^
a.cc:12:5: error: expected primary-expression before '?' token
   12 | ????????int j, i, v;
      |     ^
a.cc:12:6: error: expected primary-expression before '?' token
   12 | ????????int j, i, v;
      |      ^
a.cc:12:7: error: expected primary-expression before '?' token
   12 | ????????int j, i, v;
      |       ^
a.cc:12:8: error: expected primary-expression before '?' token
   12 | ????????int j, i, v;
      |        ^
a.cc:12:9: error: expected primary-expression before 'int'
   12 | ????????int j, i, v;
      |         ^~~
a.cc:12:9: error: expected ':' before 'int'
   12 | ????????int j, i, v;
      |         ^~~
      |         :
a.cc:12:9: error: expected primary-expression before 'int'
   12 | ????????int j, i, v;
      |         ^~~
a.cc:12:9: error: expected ':' before 'int'
   12 | ????????int j, i, v;
      |         ^~~
      |         :
a.cc:12:9: error: expected primary-expression before 'int'
   12 | ????????int j, i, v;
      |         ^~~
a.cc:12:9: error: expected ':' before 'int'
   12 | ????????int j, i, v;
      |         ^~~
      |         :
a.cc:12:9: error: expected primary-expression before 'int'
   12 | ????????int j, i, v;
      |         ^~~
a.cc:12:9: error: expected ':' before 'int'
   12 | ????????int j, i, v;
      |         ^~~
      |         :
a.cc:12:9: error: expected primary-expression before 'int'
   12 | ????????int j, i, v;
      |         ^~~
a.cc:12:9: error: expected ':' before 'int'
   12 | ????????int j, i, v;
      |         ^~~
      |         :
a.cc:12:9: error: expected primary-expression before 'int'
   12 | ????????int j, i, v;
      |