Language: C++

#include<iostream>
int main()
{
????????int density[10][10] = {};
????????int x, y, size;
????????char comma;
????????while (std::cin >> x >> comma >> y >> comma >> size) {
????????????????switch (size) {
????????????????case 3:
????????????????????????if (x - 2 >= 0) ++density[x - 2][y];
????????????????????????if (y - 2 >= 0) ++density[x][y - 2];
????????????????????????if (x + 2 < 10) ++density[x + 2][y];
????????????????????????if (y + 2 < 10) ++density[x][y + 2];
????????????????????????// fall through
????????????????case 2:
????????????????????????if (x - 1 >= 0 && y - 1 >= 0) ++density[x - 1][y - 1];
????????????????????????if (x - 1 >= 0 && y + 1 < 10) ++density[x - 1][y + 1];
????????????????????????if (x + 1 < 10 && y - 1 >= 0) ++density[x + 1][y - 1];
????????????????????????if (x + 1 < 10 && y + 1 < 10) ++density[x + 1][y + 1];
????????????????????????// fall through
????????????????case 1:
????????????????????????if (x - 1 >= 0) ++density[x - 1][y];
????????????????????????if (y - 1 >= 0) ++density[x][y - 1];
????????????????????????if (x + 1 < 10) ++density[x + 1][y];
????????????????????????if (y + 1 < 10) ++density[x][y + 1];
????????????????}
????????????????++density[x][y];
????????}
??
????????int cnt = 0, max = 0;
????????for (int i = 0; i < 10; ++i) {
????????????????for (int j = 0; j < 10; ++j) {
????????????????????????if (density[i][j] == 0) ++cnt;
????????????????????????if (max < density[i][j]) max = density[i][j];
????????????????}
????????}
????????std::cout << cnt << std::endl << max << std::endl;
}

Compiler output:
a.cc:14:23: warning: trigraph ??/ ignored, use -trigraphs to enable [-Wtrigraphs]
   14 | ????????????????????????// fall through
a.cc:20:23: warning: trigraph ??/ ignored, use -trigraphs to enable [-Wtrigraphs]
   20 | ????????????????????????// fall through
a.cc: In function 'int main()':
a.cc:4:1: error: expected primary-expression before '?' token
    4 | ????????int density[10][10] = {};
      | ^
a.cc:4:2: error: expected primary-expression before '?' token
    4 | ????????int density[10][10] = {};
      |  ^
a.cc:4:3: error: expected primary-expression before '?' token
    4 | ????????int density[10][10] = {};
      |   ^
a.cc:4:4: error: expected primary-expression before '?' token
    4 | ????????int density[10][10] = {};
      |    ^
a.cc:4:5: error: expected primary-expression before '?' token
    4 | ????????int density[10][10] = {};
      |     ^
a.cc:4:6: error: expected primary-expression before '?' token
    4 | ????????int density[10][10] = {};
      |      ^
a.cc:4:7: error: expected primary-expression before '?' token
    4 | ????????int density[10][10] = {};
      |       ^
a.cc:4:8: error: expected primary-expression before '?' token
    4 | ????????int density[10][10] = {};
      |        ^
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int density[10][10] = {};
      |         ^~~
a.cc:4:9: error: expected ':' before 'int'
    4 | ????????int density[10][10] = {};
      |         ^~~
      |         :
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int density[10][10] = {};
      |         ^~~
a.cc:4:9: error: expected ':' before 'int'
    4 | ????????int density[10][10] = {};
      |         ^~~
      |         :
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int density[10][10] = {};
      |         ^~~
a.cc:4:9: error: expected ':' before 'int'
    4 | ????????int density[10][10] = {};
      |         ^~~
      |         :
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int density[10][10] = {};
      |         ^~~
a.cc:4:9: error: expected ':' before 'int'
    4 | ????????int density[10][10] = {};
      |         ^~~
      |         :
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int density[10][10] = {};
      |         ^~~
a.cc:4:9: error: expected ':' before 'int'
    4 | ????????int density[10][10] = {};
      |         ^~~
      |         :
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int density[10][10] = {};
      |         ^~~
a.cc:4:9: error: expected ':' before 'int'
    4 | ????????int density[10][10] = {};
      |         ^~~
      |         :
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int density[10][10] = {};
      |         ^~~
a.cc:4:9: error: expected ':' before 'int'
    4 | ????????int density[10][10] = {};
      |         ^~~
      |         :
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int density[10][10] = {};
      |         ^~~
a.cc:4:9: error: expected ':' before 'int'
    4 | ????????int density[10][10] = {};
      |         ^~~
      |         :
a.cc:4:9: error: expected primary-expression before 'int'
    4 | ????????int density[10][10] = {};
      |         ^~~
a.cc:5:1: error: expected primary-expression before '?' token
    5 | ????????int x, y, size;
      | ^
a.cc:5:2: error: expected primary-expression before '?' token
    5 | ????????int x, y, size;
      |  ^
a.cc:5:3: error: expected primary-expression before '?' token
    5 | ????????int x, y, size;
      |   ^
a.cc:5:4: error: expected primary-expression before '?' token
    5 | ????????int x, y, size;
      |    ^
a.cc:5:5: error: expected primary-expression before '?' token
    5 | ????????int x, y, size;
      |     ^
a.cc:5:6: error: expected primary-expression before '?' token
    5 | ????????int x, y, size;
      |      ^
a.cc:5:7: error: expected primary-expression before '?' token
    5 | ????????int x, y, size;
      |       ^
a.cc:5:8: error: expected primary-expression before '?' token
    5 | ????????int x, y, size;
      |        ^
a.cc:5:9: error: expected primary-expression before 'int'
    5 | ????????int x, y, size;
      |         ^~~
a.cc:5:9: error: expected ':' before 'int'
    5 | ????????int x, y, size;
      |         ^~~
      |         :
a.cc:5:9: error: expected primary-expression before 'int'
    5 | ????????int x, y, size;
      |         ^~~
a.cc:5:9: error: expected ':' before 'int'
    5 | ????????int x, y, size;
      |         ^~~
      |         :
a.cc:5:9: error: expected primary-expression before 'int'
    5 | ????????int x, y, size;
      |         ^~~
a.cc:5:9: error: expected ':' before 'int'
    5 | ????????int x, y, size;
      |         ^~~
      |         :
a.cc:5:9: error: expected primary-expression before 'int'
    5 | ????????int x, y, size;
      |         ^~~
a.cc:5:9: error: expected ':' before 'int'
    5 | ????????int x, y, size;
      |         ^~~
      |         :
a.cc:5:9: error: expected primary-expression before 'int'
    5 | ????????int x, y, size;
      |         ^~~
a.cc:5:9: error: expected ':' before 'int'
    5 | ????????int x, y, size;
      |         ^~~
      |         :
a.cc:5:9: error: expected primary-expression before 'int'
    5 | ????????int x, y, size;
      |         ^~~
a.cc:5:9: error: expected ':' before 'int'
    5 | ????????int x, y, size;
      |         ^~~
      |         :
a.cc:5:9: error: expected primary-expression before 'int'
    5 | ????????int x, y, size;
      |         ^~~
a.cc:5:9: error: expected ':' before 'int'
    5 | ????????int x, y, size;
      |         ^~~
      |         :
a.cc:5:9: error: expected primary-expression before 'int'
    5 | ????????int x, y, size;
      |         ^~~
a.cc:5:9: error: expected ':' before 'int'
    5 | ????????int x, y, size;
      |         ^~~
      |         :
a.cc:5:9: error: expected primary-expression before 'int'
    5 | ????????int x, y, size;
      |         ^~~
a.cc:6:1: error: expected primary-expression before '?' token
    6 | ????????char comma;
      | ^
a.cc:6:2: error: expected primary-expression before '?' token
    6 | ????????char comma;
      |  ^
a.cc:6:3: error: expected primary-expression before '?' token
    6 | ????????char comma;
      |   ^
a.cc:6:4: error: expected primary-expression before '?' token
    6 | ????????char comma;
      |    ^
a.cc:6:5: error: expected primary-expression before '?' token
    6 | ????????char comma;
      |     ^
a.cc:6:6: error: expected primary-expression before '?' token
    6 | ????????char comma;
      |      ^
a.cc:6:7: error: expected primary-expression before '?' token
    6 | ????????char comma;
      |       ^
a.cc:6:8: error: expected primary-expression before '?' token
    6 | ????????char comma;
      |        ^
a.cc:6:9: error: expected primary-expression before 'char'
    6 | ????????char comma;
      |         ^~~~
a.cc:6:9: error: expected ':' before 'char'
    6 | ????????char comma;
      |         ^~~~
      |         :
a.cc:6:9: error: expected primary-expression before 'char'
    6 | ????????char comma;
      |         ^~~~
a.cc:6:9: error: expected ':' before 'char'
    6 | ????????char comma;
      |         ^~~~
      |         :
a.cc:6:9: error: expected primary-expression before 'char'
    6 | ????????char comma;
      |         ^~~~
a.cc:6:9: error: expected ':' before 'char'
    6 | ????????char comma;
      |         ^~~~
      |         :
a.cc:6:9: error: expected primary-expression before 'char'
    6 | ????????char comma;
      |         ^~~~
a.cc:6:9: error: expected ':' before 'char'
    6 | ????????char comma;
      |         ^~~~
      |         :
a.cc:6:9: error: expected primary-expression before 'char'
    6 | ????????char comma;
      |         ^~~~
a.cc:6:9: error: expected ':' before 'char'
    6 | ????????char comma;
      |         ^~~~
      |         :
a.cc:6:9: error: expected primary-expression before 'char'
    6 | ????????char comma;
      |         ^~~~
a.cc:6:9: error: expected ':' before 'char'
    6 | ????????char comma;
      |         ^~~~
      |         :
a.cc:6:9: error: expected primary-expression before 'char'
    6 | ????????char comma;
      |         ^~~~
a.cc:6:9: error: expected ':' before 'char'
    6 | ????????char comma;
      |         ^~~~
      |         :
a.cc:6:9: error: expected primary-expression before 'char'
    6 | ????????char comma;
      |         ^~~~
a.cc:6:9: error: expected ':' before 'char'
    6 | ????????char comma;
      |         ^~~~
      |         :
a.cc:6:9: error: expected primary-expression before 'char'
    6 | ????????char comma;
      |         ^~~~
a.cc:7:1: error: expected primary-expression before '?' token
    7 | ????????while (std::cin >> x >> comma >> y >> comma >> size) {
      | ^
a.cc:7:2: error: expected primary-expression before '?' token
    7 | ????????while (std::cin >> x >> comma >> y >> comma >> size) {
      |  ^
a.cc:7:3: error: expected primary-expression before '?' token
    7 | ????????while (std::cin >> x >> comma >> y >> comma >> size) {
      |   ^
a.cc:7:4: error: expected primary-expression before '?' token
    7 | ????????while (std::cin >> x >> comma >> y >> comma >> size) {
      |    ^
a.cc:7:5: error: expected primary-expression before '?' token
    7 | ????????while (std::cin >> x >> comma >> y >> comma >> size) {
      |     ^
a.cc:7:6: error: expected primary-expression before '?' token
    7 | ????????while (std::cin >> x >> comma >> y >> comma >> size) {
      |      ^
a.cc:7:7: error: expected primary-expression before '?' token
    7 | ????????while (std::cin >> x >> comma >> y >> comma >> size) {
      |       ^
a.cc:7:8: error: expected primary-expression before '?' token
    7 | ????????while (std::cin >> x >> comma >> y >> comma >> size) {
      |        ^
a.cc:7:9: error: expected primary-expression before 'while'
    7 | ????????while (std::cin >> x >> comma >> y >> comma >> size) {
      |         ^~~~~
a.cc:7:9: error: expected ':' before 'while'
    7 | ????????while (std::cin >> x >> comma >> y >> comma >> size) {
      |         ^~~~~
      |         :
a.cc:7:9: error: expec