Language: C++

#include <iostream>
#include <vector>
#include <map>

using namespace std;

pair<int , int> d(8);

int cntmine(int x, int y, vector<vector<char>> &V){
  int a = 0;
  for(int i = 0; i < d.size(); i++){
    int dx = x + d.first;
    int dy = y + d.second;
    if(dx >= W || dy >= H || dx < 0 || dy < 0) continue;
    if(V[dy][dx] == "#") a++;
  }
  return a;
}

int main(){
  d[0] = make_pair(0,1);
  d[1] = make_pair(1,0);
  d[2] = make_pair(0,-1);
  d[3] = make_pair(-1,0);
  d[4] = make_pair(1,1);
  d[5] = make_pair(1,-1);
  d[6] = make_pair(-1,1);
  d[7] = make_pair(-1,-1);
  
  int H, W;
  cin >> H >> W;
  vector<vector<char>> V(H, vector<char> (W,'.'));
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++) cin >> V[H][W];
  }
  
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      char c;
      c = V[H][W];
      if(c == '.') V[i][j] = cntmine(j,i,V);
    }
  }
  
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      char c;
      c = V[H][W];
      cout << c;
    }
    cout << endl;
  }
}


Compiler output:
a.cc:7:20: error: no matching function for call to 'std::pair<int, int>::pair(int)'
    7 | pair<int , int> d(8);
      |                    ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:913:28: note: candidate: 'template<class _U1, class _U2, typename std::enable_if<(std::_PCC<((! std::is_same<int, _U1>::value) || (! std::is_same<int, _U2>::value)), int, int>::_MoveConstructiblePair<_U1, _U2>() && (! std::_PCC<((! std::is_same<int, _U1>::value) || (! std::is_same<int, _U2>::value)), int, int>::_ImplicitlyMoveConvertiblePair<_U1, _U2>())), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(std::pair<_U1, _U2>&&) [with _U2 = _U1; typename std::enable_if<(std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_MoveConstructiblePair<_U1, _U2>() && (! std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_ImplicitlyMoveConvertiblePair<_U1, _U2>())), bool>::type <anonymous> = _U2; _T1 = int; _T2 = int]'
  913 |         explicit constexpr pair(pair<_U1, _U2>&& __p)
      |                            ^~~~
/usr/include/c++/14/bits/stl_pair.h:913:28: note:   template argument deduction/substitution failed:
a.cc:7:20: note:   mismatched types 'std::pair<_T1, _T2>' and 'int'
    7 | pair<int , int> d(8);
      |                    ^
/usr/include/c++/14/bits/stl_pair.h:902:19: note: candidate: 'template<class _U1, class _U2, typename std::enable_if<(std::_PCC<((! std::is_same<int, _U1>::value) || (! std::is_same<int, _U2>::value)), int, int>::_MoveConstructiblePair<_U1, _U2>() && std::_PCC<((! std::is_same<int, _U1>::value) || (! std::is_same<int, _U2>::value)), int, int>::_ImplicitlyMoveConvertiblePair<_U1, _U2>()), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(std::pair<_U1, _U2>&&) [with _U2 = _U1; typename std::enable_if<(std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_MoveConstructiblePair<_U1, _U2>() && std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_ImplicitlyMoveConvertiblePair<_U1, _U2>()), bool>::type <anonymous> = _U2; _T1 = int; _T2 = int]'
  902 |         constexpr pair(pair<_U1, _U2>&& __p)
      |                   ^~~~
/usr/include/c++/14/bits/stl_pair.h:902:19: note:   template argument deduction/substitution failed:
a.cc:7:20: note:   mismatched types 'std::pair<_T1, _T2>' and 'int'
    7 | pair<int , int> d(8);
      |                    ^
/usr/include/c++/14/bits/stl_pair.h:891:28: note: candidate: 'template<class _U1, class _U2, typename std::enable_if<(_MoveConstructiblePair<_U1, _U2>() && (! _ImplicitlyMoveConvertiblePair<_U1, _U2>())), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(_U1&&, _U2&&) [with _U2 = _U1; typename std::enable_if<(std::_PCC<true, _T1, _T2>::_MoveConstructiblePair<_U1, _U2>() && (! std::_PCC<true, _T1, _T2>::_ImplicitlyMoveConvertiblePair<_U1, _U2>())), bool>::type <anonymous> = _U2; _T1 = int; _T2 = int]'
  891 |         explicit constexpr pair(_U1&& __x, _U2&& __y)
      |                            ^~~~
/usr/include/c++/14/bits/stl_pair.h:891:28: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_pair.h:881:19: note: candidate: 'template<class _U1, class _U2, typename std::enable_if<(_MoveConstructiblePair<_U1, _U2>() && _ImplicitlyMoveConvertiblePair<_U1, _U2>()), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(_U1&&, _U2&&) [with _U2 = _U1; typename std::enable_if<(std::_PCC<true, _T1, _T2>::_MoveConstructiblePair<_U1, _U2>() && std::_PCC<true, _T1, _T2>::_ImplicitlyMoveConvertiblePair<_U1, _U2>()), bool>::type <anonymous> = _U2; _T1 = int; _T2 = int]'
  881 |         constexpr pair(_U1&& __x, _U2&& __y)
      |                   ^~~~
/usr/include/c++/14/bits/stl_pair.h:881:19: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_pair.h:869:9: note: candidate: 'template<class _U2, typename std::enable_if<std::__and_<std::is_pointer<int>, std::__not_<std::is_reference<_Tp> >, std::is_constructible<int, _U1>, std::__not_<std::is_constructible<int, const _U1&> >, std::__not_<std::is_convertible<_Iter, int> > >::value, bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(__zero_as_null_pointer_constant, _U2&&, ...) [with typename std::enable_if<std::__and_<std::is_pointer<_Tp>, std::__not_<std::is_reference<_U1> >, std::is_constructible<_T2, _U2>, std::__not_<std::is_constructible<_T1, const _U1&> >, std::__not_<std::is_convertible<_U2, _T2> > >::value, bool>::type <anonymous> = _U2; _T1 = int; _T2 = int]'
  869 |         pair(__zero_as_null_pointer_constant, _U2&& __y, ...)
      |         ^~~~
/usr/include/c++/14/bits/stl_pair.h:869:9: note:   candidate expects at least 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_pair.h:856:9: note: candidate: 'template<class _U2, typename std::enable_if<std::__and_<std::is_pointer<int>, std::__not_<std::is_reference<_Tp> >, std::is_constructible<int, _U1>, std::__not_<std::is_constructible<int, const _U1&> >, std::is_convertible<_Iter, int> >::value, bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(__zero_as_null_pointer_constant, _U2&&, ...) [with typename std::enable_if<std::__and_<std::is_pointer<_Tp>, std::__not_<std::is_reference<_U1> >, std::is_constructible<_T2, _U2>, std::__not_<std::is_constructible<_T1, const _U1&> >, std::is_convertible<_U2, _T2> >::value, bool>::type <anonymous> = _U2; _T1 = int; _T2 = int]'
  856 |         pair(__zero_as_null_pointer_constant, _U2&& __y, ...)
      |         ^~~~
/usr/include/c++/14/bits/stl_pair.h:856:9: note:   candidate expects at least 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_pair.h:843:9: note: candidate: 'template<class _U1, typename std::enable_if<std::__and_<std::__not_<std::is_reference<_Tp> >, std::is_pointer<int>, std::is_constructible<int, _U1>, std::__not_<std::is_constructible<int, const _U1&> >, std::__not_<std::is_convertible<_Iter, int> > >::value, bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(_U1&&, __zero_as_null_pointer_constant, ...) [with typename std::enable_if<std::__and_<std::__not_<std::is_reference<_U1> >, std::is_pointer<_T2>, std::is_constructible<_T1, _U1>, std::__not_<std::is_constructible<_T1, const _U1&> >, std::__not_<std::is_convertible<_Iter, _Iterator> > >::value, bool>::type <anonymous> = _U1; _T1 = int; _T2 = int]'
  843 |         pair(_U1&& __x, __zero_as_null_pointer_constant, ...)
      |         ^~~~
/usr/include/c++/14/bits/stl_pair.h:843:9: note:   candidate expects at least 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_pair.h:830:9: note: candidate: 'template<class _U1, typename std::enable_if<std::__and_<std::__not_<std::is_reference<_Tp> >, std::is_pointer<int>, std::is_constructible<int, _U1>, std::__not_<std::is_constructible<int, const _U1&> >, std::is_convertible<_Iter, int> >::value, bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(_U1&&, __zero_as_null_pointer_constant, ...) [with typename std::enable_if<std::__and_<std::__not_<std::is_reference<_U1> >, std::is_pointer<_T2>, std::is_constructible<_T1, _U1>, std::__not_<std::is_constructible<_T1, const _U1&> >, std::is_convertible<_Iter, _Iterator> >::value, bool>::type <anonymous> = _U1; _T1 = int; _T2 = int]'
  830 |         pair(_U1&& __x, __zero_as_null_pointer_constant, ...)
      |         ^~~~
/usr/include/c++/14/bits/stl_pair.h:830:9: note:   candidate expects at least 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_pair.h:789:28: note: candidate: 'template<class _U1, class _U2, typename std::enable_if<(std::_PCC<((! std::is_same<int, _U1>::value) || (! std::is_same<int, _U2>::value)), int, int>::_ConstructiblePair<_U1, _U2>() && (! std::_PCC<((! std::is_same<int, _U1>::value) || (! std::is_same<int, _U2>::value)), int, int>::_ImplicitlyConvertiblePair<_U1, _U2>())), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(const std::pair<_U1, _U2>&) [with _U2 = _U1; typename std::enable_if<(std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_ConstructiblePair<_U1, _U2>() && (! std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_ImplicitlyConvertiblePair<_U1, _U2>())), bool>::type <anonymous> = _U2; _T1 = int; _T2 = int]'
  789 |         explicit constexpr pair(const pair<_U1, _U2>& __p)
      |                            ^~~~
/usr/include/c++/14/bits/stl_pair.h:789:28: note:   template argument deduction/substitution failed:
a.cc:7:20: note:   mismatched types 'const std::pair<_T1, _T2>' and 'int'
    7 | pair<int , int> d(8);
      |                    ^
/usr/include/c++/14/bits/stl_pair.h:779:19: note: candidate: 'template<class _U1, class _U2, typename std::enable_if<(std::_PCC<((! std::is_same<int, _U1>::value) || (! std::is_same<int, _U2>::value)), int, int>::_ConstructiblePair<_U1, _U2>() && std::_PCC<((! std::is_same<int, _U1>::value) || (! std::is_same<int, _U2>::value)), int, int>::_ImplicitlyConvertiblePair<_U1, _U2>()), bool>::type <anonymous> > constexpr std::pair<_T1, _T2>::pair(const std::pair<_U1, _U2>&) [with _U2 = _U1; typename std::enable_if<(std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_ConstructiblePair<_U1, _U2>() && std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_ImplicitlyConvertiblePair<_U1, _U2>()), bool>::type <anonymous> = _U2; _T1 = int; _T2 = int]'
  779 |         constexpr pair(const pair<_U1, _U2>& __p)
      |                   ^~~~
/usr/include/c++/14/bits/stl_pair.h:779:19: note:   template argument deduction/substitution failed:
a.cc:7:20: note:   mismatched types 'const std::pair<_T1, _T2>' and 'int'
    7 | p