• + 1 comment

    Very slight improvement to your if-then-else:

      if (i > 9)
        cout << a[i % 2] << endl;
      else
        cout << a[i + 1] << endl;