Language: C++

#include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) push_back(a)
#define mk(a,b) make_pair(a,b)
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

int main(){

	while(1){
		int data[7]={22,60,6,38,24,42,20},a=0,b=0,sum=0;
		char x;
		rer(i,1,8){
			rer(j,1,8){
				if(~(cin>>x)) return 0;
				//if(cin.eof()) return 0;//!!!!!!!
				if(x=='1'){
					if(a==0 && b==0){
						a=i; b=j;
					}else{
						sum+=10*(i-a)+j-b;
					}
				}
				//o(sum);
			}
		}
		rep(i,0,7){
			if(sum==data[i]){
				char c;
				c='A'+i;
				o(c); break;
			}
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:36: error: no match for 'operator~' (operand type is 'std::basic_istream<char>')
   23 |                                 if(~(cin>>x)) return 0;
      |                                    ^~~~~~~~~
a.cc:23:36: note: candidate: 'operator~(int)' (built-in)
a.cc:23:36: note:   no known conversion for argument 1 from 'std::basic_istream<char>' to 'int'
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41,
                 from a.cc:1:
/usr/include/c++/14/cstddef:151:3: note: candidate: 'constexpr std::byte std::operator~(byte)'
  151 |   operator~(byte __b) noexcept
      |   ^~~~~~~~
/usr/include/c++/14/cstddef:151:18: note:   no known conversion for argument 1 from 'std::basic_istream<char>' to 'std::byte'
  151 |   operator~(byte __b) noexcept
      |             ~~~~~^~~
In file included from /usr/include/c++/14/streambuf:43,
                 from /usr/include/c++/14/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/bits/ios_base.h:99:3: note: candidate: 'constexpr std::_Ios_Fmtflags std::operator~(_Ios_Fmtflags)'
   99 |   operator~(_Ios_Fmtflags __a) _GLIBCXX_NOTHROW
      |   ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:99:27: note:   no known conversion for argument 1 from 'std::basic_istream<char>' to 'std::_Ios_Fmtflags'
   99 |   operator~(_Ios_Fmtflags __a) _GLIBCXX_NOTHROW
      |             ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:149:3: note: candidate: 'constexpr std::_Ios_Openmode std::operator~(_Ios_Openmode)'
  149 |   operator~(_Ios_Openmode __a) _GLIBCXX_NOTHROW
      |   ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:149:27: note:   no known conversion for argument 1 from 'std::basic_istream<char>' to 'std::_Ios_Openmode'
  149 |   operator~(_Ios_Openmode __a) _GLIBCXX_NOTHROW
      |             ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:196:3: note: candidate: 'constexpr std::_Ios_Iostate std::operator~(_Ios_Iostate)'
  196 |   operator~(_Ios_Iostate __a) _GLIBCXX_NOTHROW
      |   ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:196:26: note:   no known conversion for argument 1 from 'std::basic_istream<char>' to 'std::_Ios_Iostate'
  196 |   operator~(_Ios_Iostate __a) _GLIBCXX_NOTHROW
      |             ~~~~~~~~~~~~~^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:176:
/usr/include/c++/14/future:177:20: note: candidate: 'constexpr std::launch std::operator~(launch)'
  177 |   constexpr launch operator~(launch __x) noexcept
      |                    ^~~~~~~~
/usr/include/c++/14/future:177:37: note:   no known conversion for argument 1 from 'std::basic_istream<char>' to 'std::launch'
  177 |   constexpr launch operator~(launch __x) noexcept
      |                              ~~~~~~~^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:198:
/usr/include/c++/14/charconv:642:3: note: candidate: 'constexpr std::chars_format std::operator~(chars_format)'
  642 |   operator~(chars_format __fmt) noexcept
      |   ^~~~~~~~
/usr/include/c++/14/charconv:642:26: note:   no known conversion for argument 1 from 'std::basic_istream<char>' to 'std::chars_format'
  642 |   operator~(chars_format __fmt) noexcept
      |             ~~~~~~~~~~~~~^~~~~