Language: C++

#include <iostream>
#include <vector>
#include <utility>
#include <algorithm>
#define ppp pair<pair<int, int>, int>
using namespace std;

int main()
{
    int N;
    cin >> N;

    vector<ppp> A(N);
    bool flag = false;
    for (int i = 0; i < N; ++i)
    {
        cin >> A[i].first.first >> A[i].first.second >> A[i].second;
        if (A[i].second != 0)
            flag = true;
    }

    if (flag)
    {
        for (int i = 0; i <= 100; ++i)
        {
            for (int j = 0; j <= 100; ++j)
            {
                int k = 0;
                int H = 0;
                while (k < N)
                {
                    if (A[k].second != 0)
                    {
                        H = abs(i - A[k].first.first) + abs(j - A[k].first.second) + A[k].second;
                        break;
                    }
                }
                for (k = 0; k < N; ++k)
                {
                    int h = max(H - abs(i - A[k].first.first) - abs(j - A[k].first.second), 0);
                    if (h != A[k].second)
                        break;
                }
                if (k != N)
                    continue;
                else
                {
                    cout << i << " " << j << " " << H << endl;
                    return 0;
                }
            }
        }
    }
    else
    {
        for (int i = 0; i <= 100; ++i)
        {
            for (int j = 0; j <= 100; ++j)
            {
                for (int H = 0; H <= 100 : ++H)
                {
                    for (k = 0; k < N; ++k)
                    {
                        int h = max(H - abs(i - A[k].first.first) - abs(j - A[k].first.second), 0);
                        if (h != A[k].second)
                            break;
                    }
                    if (k != N)
                        continue;
                    else
                    {
                        cout << i << " " << j << " " << H << endl;
                        return 0;
                    }
                }
            }
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:33: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   60 |                 for (int H = 0; H <= 100 : ++H)
      |                                 ^
a.cc:60:41: error: expected ';' before ':' token
   60 |                 for (int H = 0; H <= 100 : ++H)
      |                                         ^~
      |                                         ;
a.cc:76:13: error: expected primary-expression before '}' token
   76 |             }
      |             ^
a.cc:75:18: error: expected ';' before '}' token
   75 |                 }
      |                  ^
      |                  ;
   76 |             }
      |             ~     
a.cc:76:13: error: expected primary-expression before '}' token
   76 |             }
      |             ^
a.cc:75:18: error: expected ')' before '}' token
   75 |                 }
      |                  ^
      |                  )
   76 |             }
      |             ~     
a.cc:60:21: note: to match this '('
   60 |                 for (int H = 0; H <= 100 : ++H)
      |                     ^
a.cc:76:13: error: expected primary-expression before '}' token
   76 |             }
      |             ^