Language: C++

#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)

using namespace std;

int s, T;
vector<string> V(0);

void judge(int k, vector<string> &vec){
  bool x = true;
  rep(i, T.size()){
    if(s[k+i] == "?"){
      s[k+i]="a"
    }
    else if(s[k+i] != T[i]){
      x = false;
      break;
    }    
  }
  
  if(x){
    vec.push_back(s);
  }
  return;
}
    
int main(){
  cin >> s >> T;
  rep(i, s.size()-T.size()){
    judge(i, V);
  }
  
  sort(V.begin(), V.end());
  cout << V[0] << endl;
}
  
  
  

Compiler output:
a.cc: In function 'void judge(int, std::vector<std::__cxx11::basic_string<char> >&)':
a.cc:11:12: error: request for member 'size' in 'T', which is of non-class type 'int'
   11 |   rep(i, T.size()){
      |            ^~~~
a.cc:2:38: note: in definition of macro 'rep'
    2 | #define rep(i, n) for(int i = 0; i < n; i++)
      |                                      ^
a.cc:12:9: error: invalid types 'int[int]' for array subscript
   12 |     if(s[k+i] == "?"){
      |         ^
a.cc:13:8: error: invalid types 'int[int]' for array subscript
   13 |       s[k+i]="a"
      |        ^
a.cc:15:14: error: invalid types 'int[int]' for array subscript
   15 |     else if(s[k+i] != T[i]){
      |              ^
a.cc:15:24: error: invalid types 'int[int]' for array subscript
   15 |     else if(s[k+i] != T[i]){
      |                        ^
a.cc:22:18: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::push_back(int&)'
   22 |     vec.push_back(s);
      |     ~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'int' to 'const std::vector<std::__cxx11::basic_string<char> >::value_type&' {aka 'const std::__cxx11::basic_string<char>&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'int' to 'std::vector<std::__cxx11::basic_string<char> >::value_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc: In function 'int main()':
a.cc:29:12: error: request for member 'size' in 's', which is of non-class type 'int'
   29 |   rep(i, s.size()-T.size()){
      |            ^~~~
a.cc:2:38: note: in definition of macro 'rep'
    2 | #define rep(i, n) for(int i = 0; i < n; i++)
      |                                      ^
a.cc:29:21: error: request for member 'size' in 'T', which is of non-class type 'int'
   29 |   rep(i, s.size()-T.size()){
      |                     ^~~~
a.cc:2:38: note: in definition of macro 'rep'
    2 | #define rep(i, n) for(int i = 0; i < n; i++)
      |                                      ^