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:24: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 '()' ?)
   24 |         for (int i = answerIndex; i < answerIndex + t.length; i++)
      |                                                     ~~^~~~~~
      |                                                             ()
a.cc:30:17: warning: case label value exceeds maximum value for type [-Wswitch-outside-range]
   30 |                 case 2:std::cout << t[i]; break;
      |                 ^~~~
a.cc:31:17: warning: case label value exceeds maximum value for type [-Wswitch-outside-range]
   31 |                 case 3:std::cout << s[i]; break;
      |                 ^~~~
a.cc:26:24: warning: switch condition has boolean value [-Wswitch-bool]
   26 |                 switch (s[i] != '?' + (t[i] != '?') * 2)
      |                        ^
a.cc:33:10: error: expected '}' at end of input
   33 |         }
      |          ^
a.cc:5:1: note: to match this '{'
    5 | {
      | ^