Language: C++

#include <iostream>
#include <string>

int main()
{
	int answerIndex = -1;
	std::string s, t;
	std::cin >> s >> t;
	for (int i = 0; i < (s.length - t.length + 1); i++)
	{
		for (int j = i; j < i + t.length; j++)
		{
			if (s.length[j] != '?' && s.length[j] != s.length[i])
			{
				//条件マッチせず
				break;
			}
			//条件マッチ
			//必ず後の方が良い。
			answerIndex = i;
		}
	}
	//条件に合う文字列が存在しない。
	if (answerIndex == -1)
	{
		std::cout << "UNRESORTABLE";
	}
	for (int i = answerIndex; i < answerIndex + t.length; i++)
	{
		//汚い
		switch (s[i] != '?' + (t[i] != '?') * 2)
		{
		case 0:std::cout << 'a'; break;
		case 1:std::cout << s[i]; break;
		case 2:std::cout << t[i]; break;
		case 3:std::cout << s[i]; break;
		}
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:32: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    9 |         for (int i = 0; i < (s.length - t.length + 1); i++)
      |                              ~~^~~~~~
      |                                      ()
a.cc:9:43: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    9 |         for (int i = 0; i < (s.length - t.length + 1); i++)
      |                                         ~~^~~~~~
      |                                                 ()
a.cc:11:43: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   11 |                 for (int j = i; j < i + t.length; j++)
      |                                         ~~^~~~~~
      |                                                 ()
a.cc:13:37: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   13 |                         if (s.length[j] != '?' && s.length[j] != s.length[i])
      |                                     ^
a.cc:13:59: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   13 |                         if (s.length[j] != '?' && s.length[j] != s.length[i])
      |                                                           ^
a.cc:13:74: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   13 |                         if (s.length[j] != '?' && s.length[j] != s.length[i])
      |                                                                          ^
a.cc:28:55: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   28 |         for (int i = answerIndex; i < answerIndex + t.length; i++)
      |                                                     ~~^~~~~~
      |                                                             ()
a.cc:35:17: warning: case label value exceeds maximum value for type [-Wswitch-outside-range]
   35 |                 case 2:std::cout << t[i]; break;
      |                 ^~~~
a.cc:36:17: warning: case label value exceeds maximum value for type [-Wswitch-outside-range]
   36 |                 case 3:std::cout << s[i]; break;
      |                 ^~~~
a.cc:31:24: warning: switch condition has boolean value [-Wswitch-bool]
   31 |                 switch (s[i] != '?' + (t[i] != '?') * 2)
      |                        ^
a.cc:38:10: error: expected '}' at end of input
   38 |         }
      |          ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^