criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
using namespace std;

int pos(string x,string y){
	int xn=x.size(),yn=y.size();
	string xr=reverse(x.begin(),x.end());
	string yr=reverse(y.begin(),y.end());
	for (int i=0;i<xn-yn+1;i++){
		bool ok=true;
	for(int j=0;j<yn;j++){
		if(xr[i+j]!=yr[j] && xr[i+j]!='?')ok=false;
	}
	if(ok)return xn-yn-i;
	}
	return -1;
}

int main(){
	string s,t;cin >>s >>t;
	int x=pos(s,t);
	if(x==-1){
	cout<<"UNRESTOREBLE"<<endl;
	return 0;
	}
	string x=s.replace(x,t.size(),t);
	replaceAll(x."?","a");
	cout<<x<<endl;
	}

Compiler output:
a.cc: In function 'int pos(std::string, std::string)':
a.cc:6:26: error: conversion from 'void' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    6 |         string xr=reverse(x.begin(),x.end());
      |                   ~~~~~~~^~~~~~~~~~~~~~~~~~~
a.cc:7:26: error: conversion from 'void' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    7 |         string yr=reverse(y.begin(),y.end());
      |                   ~~~~~~~^~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:25:16: error: conflicting declaration 'std::string x'
   25 |         string x=s.replace(x,t.size(),t);
      |                ^
a.cc:20:13: note: previous declaration as 'int x'
   20 |         int x=pos(s,t);
      |             ^
a.cc:26:22: error: expected unqualified-id before string constant
   26 |         replaceAll(x."?","a");
      |                      ^~~
a.cc:26:9: error: 'replaceAll' was not declared in this scope
   26 |         replaceAll(x."?","a");
      |         ^~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
	string s,t;
	cin>>s>>t;
	bool flag=true;
	for(int i=0;i<=s.size()-t.size()+1;i++){
		string t2=s;
		bool flag2=false;
		for(int j=0;j<t.size();j++){
			if(t2[i+j]=='?')t2[j+k]=t[j];
			if(t2[i+j]!='?'&&t2[i+j]!=t[j]){
				flag=false;
				break;
			}
			if(t2[i+j]!='?'&&t2[i+j]==t[j])flag2=true;
			if((j+1)==t.size())flag=true;
		}
		if(flag&&flag2){
			for(int j=0;j<t2.size();j++){
				if(t2[j]=='?'){
					t2[j]='a';
				}
			}
			cout<<t2<<endl;
			return 0;
		}
	}
	cout<<"UNRESTORABLE"<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:46: error: 'k' was not declared in this scope
   12 |                         if(t2[i+j]=='?')t2[j+k]=t[j];
      |                                              ^
Language: C++

#include<iostream>
#include<string>
#include<vector>
using namespace std;

int main(){
	string SS;
	string T;
	cin>>SS>>T;
	vector<string>arr;
	for(int i=0;i<=SS.length()-T.length();++i){
		bool get=true;
		for(int j=0;j<T.length();++j){
			if(SS[i+j]!=T[j] && SS[i+j]!='?'){
				get=false;
				break;
			}
		}
		if(get==true){
			string SSS=SS;
			for(int j=0;j<SSS.length();++j){
				if(i<=j && j-i<T.length()){
					SSS[j]=T[j-i];
				}
				else if(SSS[j]=='?')SSS[j]='a';
			}
			arr.push_back(SSS);
		}
	}
	sort(arr.begin(),arr.end());
	/*
	for(int i=0;i<arr.size();++i){
		cout<<arr[i]<<endl;
	}
	*/
	if(arr.size()==0)cout<<"UNRESTORABLE"<<endl;
	else cout<<arr[0]<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   30 |         sort(arr.begin(),arr.end());
      |         ^~~~
      |         short
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
  string s,t;
  cin>>s;
  cin>>t;
  int index=-1;
  bool flag=true;
  REP(i,s.size()-t.size()){
    REP(j,t.size()){
      if(s[i+j]=='?'){
        continue;
      }else if(s[i+j]==t[j]){
        continue;
      }else{
        flag=false;
        break;
      }
    }
    if(flag){
      index = i;
    }
  }
  
  if(index==-1){
    cout<<"UNRESTORABLE"<<endl;
    return 0;
  }else{
    string ans='';
    REP(i,index){
      if(s[i]=='?'){
        ans += 'a';
      }else{
        ans += s[i];
      }
    }
    ans += t;
    for(int i=index+t.size();i<s.size();i++){
      if(s[i]=='?'){
        ans += 'a';
      }else{
        ans += s[i];
      }
    }
    cout<<ans<<endl;
    return 0;
  }
  return 0;
}

Compiler output:
a.cc:30:16: error: empty character constant
   30 |     string ans='';
      |                ^~
a.cc: In function 'int main()':
a.cc:30:16: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
    string S, T; cin >> S >> T;
    int t = T.size(), s =S.size();

    int a = -5;

    if (s < t) cout << "UNRESTORABLE" << endl;
    else{
        for (int i = 0; i <= s -t; i++) {
            int b = 0;
            for (int j = 0; j < t; j++) {
                if (S[i + j] == T[j] || S[i + j] = '?') b ++;
            }
            if (b == t) a = i;
        }

        if (a == -5) cout << "UNRESTORABLE" << endl;

        else{
        string ans;
        ans = S;
        for (int i = 0; i < s; i++) {
            if ( S[i] == '?') ans[i] = 'a';
        }
        for (int i = a; i < a + t; i++) ans[i] = T[i - a];
        cout << ans << endl;
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:38: error: lvalue required as left operand of assignment
   15 |                 if (S[i + j] == T[j] || S[i + j] = '?') b ++;
Language: Java

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class AtCoder {
    private static java.util.Scanner scanner = new java.util.Scanner(System.in);

    public static void main(String[] args) {
        String s = scanner.next();
        String t = scanner.next();
        Matcher matcher = Pattern.compile("(.*)" + t.replaceAll(".", "[$0?]") + "(.*?)").matcher(s);
        System.out.println(matcher.matches() ? matcher.replaceFirst("$1" + t + "$2").replace('?', 'a') : "UNRESTORABLE");
    }
}

Compiler output:
Main.java:4: error: class AtCoder is public, should be declared in a file named AtCoder.java
public class AtCoder {
       ^
1 error
Language: C++

#include <bits/stdc++.h>
#define inf 1000000000 //1E+9
using namespace std;
string ExtractString(string s, int begin, int end){
	string t;
	for(int i=begin; i<end; i++) t+=s[i];
	return t; }// [beg, end)を抽出

int main(){
	string s,t;	cin>>s>>t;
	string v;
	vector<string> u;

	int flag;
	for(int i=0; i<=s.size()-t.size(); i++){
		flag=1;
		v.erase(v.begin(),v.end());

		for(int j=0; j<t.size(); j++){
			if(s[i+j]!=t[j] && s[i+j]!='?'){ flag=0; break; }
		}
		/*
		if(flag){
			for(int j=0; j<i; j++) v+=s[j];
			v+=t;
			for(int j=i+t.size(); j<s.size(); j++) v+=s[j];

			for(int j=0; j<v.size(); j++){
				if(v[j]=='?'){	v[j]='a';	}
			}
			u.push_back(v);
		}*/
	}


	if(u.size()==0) cout<<"UNRESTORABLE"<<endl;
	sort(u.begin(),u.end());
	else cout<<u[0]<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:9: error: 'else' without a previous 'if'
   38 |         else cout<<u[0]<<endl;
      |         ^~~~
Language: C++

#include <bits/stdc++.h>
#define inf 1000000000 //1E+9
using namespace std;
string ExtractString(string s, int begin, int end){
	string t;
	for(int i=begin; i<end; i++) t+=s[i];
	return t; }// [beg, end)を抽出

int main(){
	string s,t;	cin>>s>>t;
	string v;
	vector<string> u;

	int flag;
	for(int i=0; i<=s.size()-t.size(); i++){
		flag=1;
		v.erase(v.begin(),v.end());

		for(int j=0; j<t.size(); j++){
			if(s[i+j]!=t[j] && s[i+j]!='?'){ flag=0; break; }
		}
		/*
		if(flag){
			for(int j=0; j<i; j++) v+=s[j];
			v+=t;
			for(int j=i+t.size(); j<s.size(); j++) v+=s[j];

			for(int j=0; j<v.size(); j++){
				if(v[j]=='?'){	v[j]='a';	}
			}
			u.push_back(v);
		}*/
	}


	if(u.size()==0) cout<<"UNRESTORABLE"<<endl;
	sort(u.begin(),u.end())
	else cout<<u[0]<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:32: error: expected ';' before 'else'
   37 |         sort(u.begin(),u.end())
      |                                ^
      |                                ;
   38 |         else cout<<u[0]<<endl;
      |         ~~~~
Language: C++

#include <iostream>
#include <vector>
#include <string>
using namespace std;


int main()
{
    string S, T;
    cin >> S;
    cin >> T;

    if (s.size() < t.size()) {
        cout << "UNRESTORABLE" << endl;
        return 0;
    }
    
    int beginSubstring = -1;
    for( int i = 0; i <= S.size()-T.size(); ++i ){
        bool isMatch = true;
        for( int j = 0; j < T.size(); ++j ){
            if( S[i+j] != T[j] && S[i+j] != '?' ){
                isMatch = false;
                break;
            }
        }
        if( isMatch ) beginSubstring = i;
    }

    if( beginSubstring < 0 ) cout << "UNRESTORABLE" << endl;
    else{
        string ans;
        for( int i = 0; i < S.size(); ++i ){
            if( i == beginSubstring ){
                ans += T;
                i += T.size() - 1;
            }else if( S[i] == '?' ) ans += 'a';
            else ans += S[i];
        }
        cout << ans << endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 's' was not declared in this scope
   13 |     if (s.size() < t.size()) {
      |         ^
a.cc:13:20: error: 't' was not declared in this scope
   13 |     if (s.size() < t.size()) {
      |                    ^
Language: C++

#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>

using namespace std;
 
#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v.begin(), v.end())
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
 
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }
 
typedef long long  ll;
 
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

string s;
    string t;
    int S=s.size();
    int T=t.size();

 bool match(int k){
     for(int i=0;i<t.size();i++){
     if(t[i]!=s[i+k] && s[i+k]!='?') {
         return false;
     }
 }

 return true;
 }
 string construct(int k){
     string ans=s;
     for(int i=0;i<t.size();i++){
         ans[k+i]=t[i];
     }
    for(int i=0;i<s.size();i++){
        if(ans[i]=='?'){
            ans[i]='a';
    }
    }
    return ans;
 }
    
    
int main() {
    
    cin>>s>>t;
    vector<string>v;
    int cnt=0;
    if(s.size()-t.size()<0){
         cout<<"UNRESTORABLE"<<endl;
        return 0;
    }
    
    for(int k=0;k<(=s.size()-t.size());k++){
        if(match(k)){
            v.push_back(construct(k));
            cnt++;
            //cout<<construct(k)<<endl;
        }


    }
    if(cnt==0){
        cout<<"UNRESTORABLE"<<endl;
        return 0;
    }

    sort(v.begin(),v.end());
    cout<<v[0]<<endl;
   
return 0;
}
    
 


Compiler output:
a.cc: In function 'int main()':
a.cc:86:20: error: expected primary-expression before '=' token
   86 |     for(int k=0;k<(=s.size()-t.size());k++){
      |                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main () {
  string S, T;
  cin >> S >> T;
  int count = 0;;
  for (int i = 0; i < S.size() - T.size() + 1; i++) {
    for (int j = 0; j < T.size(); j++) {
    　　if (S.at(i + j) == T.at(j) || S.at(i + j) == '?') {
        S.at(i + j) == T.at(j);
        count++;
      }
    }
  }
  for (int i = 0; i < S.size(); i++) {
    if (S.at(i) == '?') S.at(i) = 'a'; 
  }
  if (count == T.size()) cout << S << endl;
  else cout << "UNRESTORABLE" << endl;
  return 0;
}

Compiler output:
a.cc:9:5: error: extended character 　 is not valid in an identifier
    9 |     　　if (S.at(i + j) == T.at(j) || S.at(i + j) == '?') {
      |     ^
a.cc:9:5: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:9:5: error: '\U00003000\U00003000if' was not declared in this scope
    9 |     　　if (S.at(i + j) == T.at(j) || S.at(i + j) == '?') {
      |     ^~~~~~
Language: C++

typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
#define MP make_pair
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define VI vector<int>
#define PII pair<int, int>
#define FI first
#define SE second
#define ALL(x) (x).begin(), (x).end()
const int INF=1<<30;
const ll LINF=1LL<<60 ;
const ll MOD=1e9+7 ;
///////////////////



int main(){
    bool sub = false;
    int plc = 0;
    string s,t, ans; cin >> s >> t;
    if(s.size() < t.size()){
       cout << "UNRESTORABLE"; return 0;
    }

    for(int i=s.size()-1;i>=t.size()-1;i--){
        int st = i-t.size()+1;
        bool csub = true;
        if(s[i] == '?'){
            for(int j=0;j<t.size();j++){
                if(s[st+j] != t[j] && s[st+j] != '?'){
                    csub = false;
                    break;
                }
            }
            if(csub == true){
                plc = st;
                sub = true;
                break;
            }
        }
    }

    if(sub){
        FOR(i,0,s.size()-1){
            if(plc <= i && i < plc+t.size()){
                ans[i] = t[i-plc];
            }else if(s[i] == '?'){
                ans[i] = 'a';
            }else{
                ans[i] = s[i];
            }
            cout << ans[i];
        }
    }else{
        cout << "UNRESTORABLE";
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: 'string' was not declared in this scope
   21 |     string s,t, ans; cin >> s >> t;
      |     ^~~~~~
a.cc:21:22: error: 'cin' was not declared in this scope
   21 |     string s,t, ans; cin >> s >> t;
      |                      ^~~
a.cc:21:29: error: 's' was not declared in this scope
   21 |     string s,t, ans; cin >> s >> t;
      |                             ^
a.cc:21:34: error: 't' was not declared in this scope
   21 |     string s,t, ans; cin >> s >> t;
      |                                  ^
a.cc:23:8: error: 'cout' was not declared in this scope
   23 |        cout << "UNRESTORABLE"; return 0;
      |        ^~~~
a.cc:47:17: error: 'ans' was not declared in this scope
   47 |                 ans[i] = t[i-plc];
      |                 ^~~
a.cc:49:17: error: 'ans' was not declared in this scope
   49 |                 ans[i] = 'a';
      |                 ^~~
a.cc:51:17: error: 'ans' was not declared in this scope
   51 |                 ans[i] = s[i];
      |                 ^~~
a.cc:53:13: error: 'cout' was not declared in this scope
   53 |             cout << ans[i];
      |             ^~~~
a.cc:53:21: error: 'ans' was not declared in this scope
   53 |             cout << ans[i];
      |                     ^~~
a.cc:56:9: error: 'cout' was not declared in this scope
   56 |         cout << "UNRESTORABLE";
      |         ^~~~
Language: C

try:
    S = list(input())
    T = list(input())
    t = len(T)
    candidate = []
    for i in range(len(S)):
        tmp = S[i:i+t]
        for j in range(len(tmp)):
            if tmp[j] == T[j] or '?' == tmp[j]:
                pass
            else:
                break
        else:
            candidate.append(S[0:i]+T+S[i+t:len(S)])
    for i in range(len(candidate)):
        l = list(candidate[i])
        for j in range(len(l)):
            if l[j] == '?':
                l[j] = 'a'
        candidate[i]=l
    candidate = list(filter(lambda x:len(x)==len(S),candidate))
    candidate.sort()
    for x in candidate[0]:
        print(x,end='')
    print()
except:
    print("UNRESTORABLE")

Compiler output:
main.c:1:4: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
    1 | try:
      |    ^
main.c:24:21: error: empty character constant
   24 |         print(x,end='')
      |                     ^~
Language: C++

#include "bits/stdc++.h"
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define BUGAVOID(x) x
#define rep(...) BUGAVOID(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define sz(c) (int)(c.size())
#define all(c) c.begin(),c.end()
#define ms(a,v) memset(a,v,sizeof(a))
#define unq(v) v.erase(unique(v.begin(),v.end()),v.end());
#define mp make_pair
#define write(x) cout<<(x)<<endl
using namespace std; typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; }return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; }return 0; }
const int INF = 1 << 28; const ll LINF = 1ll << 60;
const int MAX = 1e5 + 5; const int MOD = 1e9 + 7; const double EPS = 1e-6;
const int dy[4] = { 0,1,0,-1 }; const int dx[4] = { 1,0,-1,0 };
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); }; }aaaa;

string Sd, T;
const string UR = "UNRESTORABLE";

int main() {
    cin >> Sd >> T;
    int Sdsize = Sd.size();
    int Tsize = T.size();

    if (Tsize > Sdsize) {
        write(UR);
        return 0;
    }

    string S(Sdsize, '{');

    rep(i, 0, Sdsize - Tsize + 1) {
        bool matches = true;
        for (int j = 0; j < Tsize; ++j) {
            if (Sd[i + j] != '?' && Sd[i + j] != T[j]) {
                matches = false;
                break;
            }
        }
        if (matches) {
            string Sdcopy = Sd;
            Sdcopy.replace(i, i + Tsize, T);
            replace(all(Sdcopy), '?', 'a');

            for (int j = 0; j < Sdsize; ++j) {
                if (Sdcopy[j] < S[j]) {
                    S = Sdcopy;
                    break;
                }
            }
        }
    }
    if (S[0] == '{') {
        write(UR);
    }
    else {
        write(S);
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:62:6: error: expected '}' at end of input
   62 |     }
      |      ^
a.cc:24:12: note: to match this '{'
   24 | int main() {
      |            ^
Language: C++

#include"pch.h"
#include <iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<math.h>
#include <cstdio>
#include<iomanip>
#include <stdio.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=n-1;i>=0;i--)
#define loop(i,m,n) for(int i=m;i<(int)(n);i++)
const int inf = 10e9 + 7;
using namespace std;

signed main() {
	string s, t;
	cin >> s >> t;
	string r = s;
	int n = s.size();
	int m = t.size();
	int sum = m - 1;
	int i = n - 1;
	while (sum >= 0) {
		if (i <= -1) { cout << "UNRESTORABLE" << endl; return 0; }
		else if (s[i] == t[sum]) { s[i] = t[sum]; sum--; }
		else if (s[i] == '?') { s[i] = t[sum]; sum--; }
		else {
			sum = m - 1;
			for(int j=n-1;j>=i;j--) {
				if (r[j] != '?')s[j] = r[j];
				else s[j] = 'a';
			}
		}
		i--;
	}
	loop(i, 0, n) {
		if (s[i] == '?')cout << 'a';
		else cout << s[i];
	}
	cout << endl;
}

Compiler output:
a.cc:1:9: fatal error: pch.h: No such file or directory
    1 | #include"pch.h"
      |         ^~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<string.h>
int main()
{   
	int l1,l2,i,j,k,t,m;
   	char S[100],T[50];
   	scanf("%s",S);
   	scanf("%s",T);
   	l1=strlen(S);
   	l2=strlen(T);
   	for(i=l1-1;i>=0;i--)
	{
			for(j=i,m=0;j<i+l2;j++,m++) 
			{
				if(S[j]=='?'||S[j]==T[m])
				continue;
				else
				break;
			} 
			if(j==i+l2)
			{
				for(k=i,m=0;k<i+l2;k++,m++)
				{
					S[k]=T[m];  
				}
				for(k=0;k<l1;k++)
				if(S[k]=='?')
					S[k]='a';
				printf("%s",S);
				return 0;
			}
		}
	}
	printf("UNRESTORABLE\n");
	return 0;
}


Compiler output:
main.c:34:16: error: expected declaration specifiers or '...' before string constant
   34 |         printf("UNRESTORABLE\n");
      |                ^~~~~~~~~~~~~~~~
main.c:35:9: error: expected identifier or '(' before 'return'
   35 |         return 0;
      |         ^~~~~~
main.c:36:1: error: expected identifier or '(' before '}' token
   36 | }
      | ^
Language: C++

#include<stdio.h>
#include<string.h>
int main(void)
{
    int z=1;
    char a[50],b[50],c[50];
    gets(a);
    gets(b);
    strcpy(c,a);
    int i,j;
    int m=strlen(a),n=strlen(b);
    for(j=0; j<m; j++)
    {
        z=1;
        int g=0;
        for(i=j,g=0; g<n; i++,g++)
        {
            if(c[i]==b[g]||c[i]=='?')
            {
                c[i]=b[g];

            }
            else
            {
                z=0;
                break;
            }
        }
        if(z==0)
        {
            strcpy(c,a);
        }
        else
        {
            break;
        }
    }
    if(z==1)
    {
        int h;
        for(h=0; h<j; h++)
        {
            if(c[h]=='?')
                c[h]='a';
        }
        for(h=m-1; h>i-1; h++)
        {
            if(c[h]=='?')
                c[h]='a';
        }
        puts(c);
    }
    else
        printf("UNRESTORABLE");
}



Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    7 |     gets(a);
      |     ^~~~
      |     getw
Language: C++

#include<stdio.h>
#include<string.h>
#pragma warning(disable:4996)
int main()
{
	char str1[51], str2[51];
	int state, uu = 0, hh = 0, jj = 0;
	scanf("%s", str1);
	scanf("%s", str2);
	for (int i = 0; i < strlen(str1); i++)
	{

		for (int j = 0; j < strlen(str2); j++)
		{
			if (str1[i+j]==str2[j]||str1[i+j]=='?')
			{
				if (j==strlen(str2)-1)
				{
					jj = i;
				}
				continue;
			}
			else
			{
				break;
			}
		}
	}
	if (jj == 0)
	{
		printf("UNRESTORABLE");
	}
	else
	{
		for (int i = 0; i < jj; i++)
		{
			if (str1[i]=='?')
			{
				printf('a');
			}
			else
			{
				printf("%c", str1[i]);
			}
		}
		printf("%s", str2);
		for (int i = jj+strlen(str2); i < strlen(str1); i++)
		{
			if (str1[i] == '?')
			{
				printf('a');
			}
			else
			{
				printf("%c", str1[i]);
			}
		}
	}
	getchar();
	getchar();
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:40: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   39 |                                 printf('a');
      |                                        ^~~
      |                                        |
      |                                        char
In file included from a.cc:1:
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:51:40: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   51 |                                 printf('a');
      |                                        ^~~
      |                                        |
      |                                        char
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
	char s[5000];
	char t[51];
	gets_s(s, 5000);
	gets_s(t, 51);
	int aim;
	int ls, lt,i,flag=0;
	ls = strlen(s);
	lt = strlen(t);
	for (aim = ls - lt; aim > -1; aim--)
	{
		if (!flag)
		{
			flag = 1;
			for (i = 0; i < lt; i++)
			{
				if (s[aim + i] != '?'&&s[aim + i] != t[i])
				{
					flag = 0;
					break;
				}
			}
		}
		else
			break;
	}
	aim++;
	if (flag)
	{
		for (i = 0; i < aim; i++)
		{
			if (s[i] == '?')
				printf("a");
			else
				printf("%c", s[i]);
		}
		printf("%s", t);
		for (i = aim + lt; i < ls; i++)
		{
			if (s[i] == '?')
				printf("a");
			else
				printf("s[i]");
		}
	}
	else
		printf("UNRESTORABLE");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'gets_s' was not declared in this scope
    8 |         gets_s(s, 5000);
      |         ^~~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int cmp(const void *a,const void *b)
{
    return strcmp((char*)a,(char*)b);
}
int main()
{
    int a,b,i,j,k;
    char A[101],B[101];
    scanf("%s",B);scanf("%s",A);//输入S和T
    a=strlen(B); b=strlen(A);//统计两个字符串的长度
   
    char D[101][101];
    int C,point,n;
    C=0;point=0;n=0;
    
    
    
        
   if(a>=b)
    
    {
        for(i=a-1;i>=0; i--)
        {
            
            if(B[i]==A[b-1]||B[i]=='?')
            {
                k=i;
                for(j=b-1; j>=0; j--)
                {
                    if(A[j]==B[k]||B[k]=='?')
                        k--;
                    
                    else
                        break;
                    
                }
                if(k==i-b)
                {
                    k=i;
                    strcpy(D[n],B);
                    for(j=b-1; j>=0; j--,k--)
                    {
                        D[n][k]=A[j];
                    }
                    for(j=0; j<a; j++)
                    {
                        if(D[n][j]=='?')
                            D[n][j]='a';
                    }
                    point=1;
                    n++;
                }}}}
            
        
    else
        printf("UNRESTORABLE");
    
    
    
    
    
    if(point!=1)
         printf("UNRESTORABLE");
    else
        {
            qsort(D,n,101*sizeof(char),cmp);
            printf("%s\n",D[0]);
        }
   



Compiler output:
main.c: In function 'main':
main.c:72:9: error: expected declaration or statement at end of input
   72 |         }
      |         ^
Language: C++

mat=cvtColor(mat,COLOR_BGR2GRAY)
mat=cvtColor(mat,COLOR_BGR2GRAY)
mat=cvtColor(mat,COLOR_BGR2GRAY)

Compiler output:
a.cc:1:1: error: 'mat' does not name a type
    1 | mat=cvtColor(mat,COLOR_BGR2GRAY)
      | ^~~
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
	char s[5000];
	char t[51];
	gets_s(s, 5000);
	gets_s(t, 51);
	int aim;
	int ls, lt,i,flag=0;
	ls = strlen(s);
	lt = strlen(t);
	for (aim = ls - lt; aim > -1; aim--)
	{
		if (!flag)
		{
			flag = 1;
			for (i = 0; i < lt; i++)
			{
				if (s[aim + i] != '?'&&s[aim + i] != t[i])
				{
					flag = 0;
					break;
				}
			}
		}
		else
			break;
	}
	aim++;
	if (flag)
	{
		for (i = 0; i < aim; i++)
		{
			if (s[i] == '?')
				printf("a");
			else
				printf("%c", s[i]);
		}
		printf("%s", t);
		for (i = aim + lt; i < ls; i++)
		{
			if (s[i] == '?')
				printf("a");
			else
				printf("s[i]");
		}
	}
	else
		printf("UNRESTORABLE");
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:9: error: implicit declaration of function 'gets_s' [-Wimplicit-function-declaration]
    8 |         gets_s(s, 5000);
      |         ^~~~~~
Language: C++

using namespace std;
#include<bits/stdc++.h>
#define BEGIN ios_base::sync_with_stdio(0);cin.tie(0)
#define END return EXIT_SUCCESS
#define FOR(I,A,B) for((I)=(A);(I)<(B);(I)++)
#define REP(I,N) FOR(I,0,N)
#define UP(I,A,B) for((I)=(A);(I)<=(B);(I)++)
#define DW(I,A,B) for((I)=(A);(I)>=(B);(I)--)
#define IN(P) cin>>(P)
#define IN2(P1,P2) cin>>(P1)>>(P2)
#define IN3(P1,P2,P3) cin>>(P1)>>(P2)>>(P3)
#define INS(I,N,V) REP(I,N) cin>>V[I]
#define INS2(I,N,V1,V2) REP(I,N) cin>>V1[I]>>V2[I];
#define INS3(I,N,V1,V2,V3) REP(I,N) cin>>V1[I]>>V2[I]>>V3[I];
#define OUT(P) cout<<P<<endl
#define OUT2(P1,P2) cout<<P1<<" "<<P2<<endl
#define OUT3(P1,P2,P3) cout<<P1<<" "<<P2<<" "<<P3<<endl
#define OUTS(I,N,V) REP(I,N) cout<<V[i]<<endl
#define ALL(C) (C).begin(),(C).end()
#define RALL(C) (C).rbegin(),(C).rend()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
typedef unsigned long ul;
const ul INF = 1LL<<60;
string S,T;
ul i,j,len1,len2;
bool is_ok,is_match;
inline void solve(){
  IN2(S,T);
  len1=S.size();
  len2=T.size();
  is_ok=false;
  DW(i,len1-len2,0){
    is_match=true;
    REP(j,len2){
      if(S[i+j]!=T[j]&&S[i+j]!='?'){
        is_match=false;
        break;
      }
    }
    if(is_match){
      REP(j,len2){
        S[i+j]=T[j];
      }
      REP(j,len1){
        if(S[j]=='?')S[j]='a';
      }
      is_ok=true;
      break
    }
  }
  if(is_ok) OUT(S);
  else OUT("UNRESTORABLE");
}

int main(int argc,char**argv){
  BEGIN;
  solve();
  END;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:49:12: error: expected ';' before '}' token
   49 |       break
      |            ^
      |            ;
   50 |     }
      |     ~
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
    char S1[50],T[50];
    int i,j,o;
    int lenS1,lenT;
    int k,p,w=0;
    gets(S1);
    gets(T);
    lenS1=strlen(S1);
    lenT=strlen(T);
    for (i=0; i<=lenS1-lenT; i++)
    {
        k=0;
        p=1;
        for (j=i; j<i+lenT; j++)
        {
            if ((S1[j]!=T[k++])&&(S1[j]!='?'))
            {
                p=0;
            }
        }
        if (p==1)
        {
            o=i;
            w=1;
        }
    }
    if (w==1)
    {
        k=0;
        for (j=o; j<o+lenT; j++)
        {
            S1[j]=T[k++];
        }
        for (i=0; i<lenS1; i++)
        {
            if (S1[i]=='?')
            {
                S1[i]='a';
            }
        }
        puts(S1);
    }
    else
    {
        printf("UNRESTORABLE");
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   10 |     gets(S1);
      |     ^~~~
      |     getw
Language: C++

#include<stdio.h>
#include<string.h>
#include<conio.h>
int check(char *p1,char *p2)			//p1是input,p2是测试数组 
{
	int len=strlen(p1),i;
	for(i=0;i<len;i++)
	{
		if(p1[i]!='?')
		{
			if(p1[i]!=p2[i])return 0;
		}
	}
	return 1;
}
void print(char *p)
{
	int len=strlen(p),i;
	for(i=0;i<len;i++)
	{
		if(p[i]=='?')
		{
			printf("a");
		}
		else
		{
			printf("%c",p[i]);
		}
	}
	printf("\n");
}
int main()
{
	int i,j,k;
	char input[51];
	char insert[51];
	char temp[51];						//接受测试数组 
	while(scanf("%s",input)!=-1)
	{
		scanf("%s",insert);
		int len1=strlen(input);
		int len2=strlen(insert);
		int count=0;
		
		for(i=0;i<=len1-len2;i++)
		{
			strcpy(temp,input);				//保护input不被破坏 
			strcpy(&temp[i],insert);
			temp[i+len2]=input[i+len2];	//把'\0'弄掉 
			if(check(input,temp))
			{
				count++;
				print(temp);
				break;
			}
		}
		if(count==0)printf("UNRESTORABLE\n");
	}
 } 

Compiler output:
a.cc:3:9: fatal error: conio.h: No such file or directory
    3 | #include<conio.h>
      |         ^~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#include<string.h>
#include<conio.h>
int check(char *p1,char *p2)			//p1是input,p2是测试数组 
{
	int len=strlen(p1),i;
	for(i=0;i<len;i++)
	{
		if(p1[i]!='?')
		{
			if(p1[i]!=p2[i])return 0;
		}
	}
	return 1;
}
void print(char *p)
{
	int len=strlen(p),i;
	for(i=0;i<len;i++)
	{
		if(p[i]=='?')
		{
			printf("a");
		}
		else
		{
			printf("%c",p[i]);
		}
	}
	printf("\n");
}
int main()
{
	int i,j,k;
	char input[51];
	char insert[51];
	char temp[51];						//接受测试数组 
	while(scanf("%s",input)!=-1)
	{
		scanf("%s",insert);
		int len1=strlen(input);
		int len2=strlen(insert);
		int count=0;
		
		for(i=0;i<=len1-len2;i++)
		{
			strcpy(temp,input);				//保护input不被破坏 
			strcpy(&temp[i],insert);
			temp[i+len2]=input[i+len2];	//把'\0'弄掉 
			if(check(input,temp))
			{
				count++;
				print(temp);
				break;
			}
		}
		if(count==0)printf("UNRESTORABLE\n");
	}
 } 

Compiler output:
main.c:3:9: fatal error: conio.h: No such file or directory
    3 | #include<conio.h>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<cstdio>
#include<cstdlib>

int main() {
	char s[51], t[51];
	std::cin >> s >> t;
	if (strlen(s) < strlen(t)) {
		printf("UNRESTORABLE");
		return 0;
	}

	for (int i = 0; i < strlen(s) - strlen(t) + 1; i++) {
		bool flag = true;
		for (int j = i; j < strlen(t)+i; j++) {
			if (s[j] != '?'&&s[j] != t[j-i]) {
				flag = false;
				break;
			}
		}
		if (flag) {
			for (int j = i; j < strlen(t)+i; j++) {
				s[j] = t[j - i];
			}
			for (int j = 0; j < strlen(s); j++) {
				if (s[j] == '?')s[j] = 'a';
			}
			printf("%s", s);
			return 0;
		}
	}
	printf("UNRESTORABLE");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'strlen' was not declared in this scope
    8 |         if (strlen(s) < strlen(t)) {
      |             ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<cstdlib>
  +++ |+#include <cstring>
    4 | 
a.cc:13:29: error: 'strlen' was not declared in this scope
   13 |         for (int i = 0; i < strlen(s) - strlen(t) + 1; i++) {
      |                             ^~~~~~
a.cc:13:29: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include<iostream>

int main() {
	char s[51], t[51];
	std::cin >> s >> t;
	if (strlen(s) < strlen(t)) {
		printf("UNRESTORABLE");
		return 0;
	}

	for (int i = 0; i < strlen(s) - strlen(t) + 1; i++) {
		bool flag = true;
		for (int j = i; j < strlen(t)+i; j++) {
			if (s[j] != '?'&&s[j] != t[j-i]) {
				flag = false;
				break;
			}
		}
		if (flag) {
			for (int j = i; j < strlen(t)+i; j++) {
				s[j] = t[j - i];
			}
			for (int j = 0; j < strlen(s); j++) {
				if (s[j] == '?')s[j] = 'a';
			}
			printf("%s", s);
			return 0;
		}
	}
	printf("UNRESTORABLE");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: 'strlen' was not declared in this scope
    6 |         if (strlen(s) < strlen(t)) {
      |             ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | 
a.cc:11:29: error: 'strlen' was not declared in this scope
   11 |         for (int i = 0; i < strlen(s) - strlen(t) + 1; i++) {
      |                             ^~~~~~
a.cc:11:29: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include "stdafx.h"
#include <algorithm>
#include <array>
#include <vector>
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <functional>
#include <queue>

//AtCoderC++.cpp

using namespace std;

void Show(vector<vector<int>> Ns) {
	for (int i = 0; i < Ns.size(); i++) {
		for (int j = 0; j < Ns[i].size(); j++) {
			if (j == Ns[i].size() - 1) {
				cout << Ns[i][j] << endl;
			} else {
				cout << Ns[i][j] << ",";
			}
		}
	}
}

void Show(vector<int> N) {
	for (int i = 0; i < N.size(); i++) {
		cout << N[i];
		if (i != N.size() - 1) {
			cout << " ";
		} else {
			cout << endl;
		}
	}
}


int main() {
	string S,T;
	cin >> S;
	cin >> T;
	int L = S.length() - T.length();
	vector<string> Keys = vector<string>();
	for (int offset = 0; offset <= L; offset++) {//尺取り虫でTをずらして、嵌められる時はQueueに追加していく。
		string key=S;
		bool accept = true;
		for (int i = 0; i < T.length(); i++) {
			if (S[offset + i] != '?' && T[i] != S[offset + i]) {
				accept = false;
				break;
			}
		}
		if (accept)Keys.push_back(key.replace(offset, offset + T.length()-1, T));
	}
	if (Keys.empty()) {
		cout << "UNRESTORABLE" << endl;
		return 0;
	}
	int N = Keys.size();
	for (int i = 0; i < N; i++) {
		replace(Keys[i].begin(), Keys[i].end(), '?', 'a');
	}
	sort(Keys.begin(), Keys.end());
	cout << Keys[0] << endl;
}


Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<algorithm>//sort(昇順)
#include<string>//F.size();文字列のサイズ
#include<cstdio>
#include<iomanip>
#include<vector>
#include<bits/stdc++.h>
#include<stack>
#include<queue>
#include<cmath>
#include<limits>
#include<map>


#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, a, b) for (int i = a; i < b; i++)

using namespace std;

int main(){
	int a,b,c=0,d=0;
	string s,t,l;
	cin >> s >> t;
	bool m[s.size()];
	
	if(s.size()<t.size()){cout << "UNRESTORABLE" << endl;return 0;}
	
	REP(i,s.size()){
		m[i]=true;
		if(s[i]=="?")
			m[i]=false;
		}
	}
	REP(i,s.size()){
		if(m[i]==false){
			c++;
			if(c==t.size()){
				d++;
				FOR(j,i-c,i)s[i]=t[i];
				break;
			}
		}else c=0;
	}
	REP(i,s.size()){
		if(m[i]==false){
			s[i] = "a";
		}
	}
	if(d<1){cout << "UNRESTORABLE" << endl;return 0;}
	cout << s << endl;
	
return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   30 |                 if(s[i]=="?")
a.cc: At global scope:
a.cc:15:19: error: expected unqualified-id before 'for'
   15 | #define REP(i, n) for (int i = 0; i < n; i++)
      |                   ^~~
a.cc:34:9: note: in expansion of macro 'REP'
   34 |         REP(i,s.size()){
      |         ^~~
a.cc:34:13: error: 'i' does not name a type
   34 |         REP(i,s.size()){
      |             ^
a.cc:15:35: note: in definition of macro 'REP'
   15 | #define REP(i, n) for (int i = 0; i < n; i++)
      |                                   ^
a.cc:34:13: error: 'i' does not name a type
   34 |         REP(i,s.size()){
      |             ^
a.cc:15:42: note: in definition of macro 'REP'
   15 | #define REP(i, n) for (int i = 0; i < n; i++)
      |                                          ^
a.cc:15:19: error: expected unqualified-id before 'for'
   15 | #define REP(i, n) for (int i = 0; i < n; i++)
      |                   ^~~
a.cc:44:9: note: in expansion of macro 'REP'
   44 |         REP(i,s.size()){
      |         ^~~
a.cc:44:13: error: 'i' does not name a type
   44 |         REP(i,s.size()){
      |             ^
a.cc:15:35: note: in definition of macro 'REP'
   15 | #define REP(i, n) for (int i = 0; i < n; i++)
      |                                   ^
a.cc:44:13: error: 'i' does not name a type
   44 |         REP(i,s.size()){
      |             ^
a.cc:15:42: note: in definition of macro 'REP'
   15 | #define REP(i, n) for (int i = 0; i < n; i++)
      |                                          ^
a.cc:49:9: error: expected unqualified-id before 'if'
   49 |         if(d<1){cout << "UNRESTORABLE" << endl;return 0;}
      |         ^~
a.cc:50:9: error: 'cout' does not name a type
   50 |         cout << s << endl;
      |         ^~~~
a.cc:52:1: error: expected unqualified-id before 'return'
   52 | return 0;}
      | ^~~~~~
a.cc:52:10: error: expected declaration before '}' token
   52 | return 0;}
      |          ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
int main(){
    string s,t;
    cin >> s >> t;
    string ans = "UNRESTORABLE";
    string temp;
    bool flag = false;
    for(int i=s.length()-1;i>=t.length()-1;i--){
        if(s.substr(i,1)=="?"){
            temp = s.substr(i-(t.length()-1),t.length());
            for(int j=0;j<t.length();j++){
                if(t.substr(j,1)!=temp.substr(j,1)&&temp.substr(j,1)!="?"){
                    break;
                }
                if(j==t.length()-1){
                    s.replace(i-(t.length()-1),i,t);
                    flag = true;
                    break;
                }
            }
        }
        if(flag == true){
            break;
        }
    }
    
    if(flag == true){
    replace(s.begin(),s.end(),'?','a');
    ans = s;
    }
     c

Compiler output:
a.cc: In function 'int main()':
a.cc:36:6: error: 'c' was not declared in this scope
   36 |      c
      |      ^
a.cc:36:7: error: expected '}' at end of input
   36 |      c
      |       ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define int long long
#define vec(a,n) vector<int> (a)((n))
#define Vec(a,n) vector<string> (a)((n))
using namespace std;
signed main(){
	string s,t;
	cin >> s >> t;
	int n = s.size();
	int m = t.size();
	int a = 1;
	if(m>n){
		a = 0;
	}
	REP(i,n-m+1){
		REP(j,m){
			if(s[i+j] != t[i+j] && s[i+j] != '?'){
				a = 0;
				break;
			}
		}
		if(a == 1){
			REP(k,i){
				if(s[k] == '?'){
					cout << "a";
				}
				else cout << a[k];
			}
			cout << t;
			FOR(l,i+m,n){
				if(s[k] == '?'){
					cout << "a";
				}
				else cout << a[k];
			}
			break;
		}
	}
	if(a == 0){
		cout << "UNRESTORABLE" << endl;
	}

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:47: error: invalid types 'long long int[long long int]' for array subscript
   29 |                                 else cout << a[k];
      |                                               ^
a.cc:33:38: error: 'k' was not declared in this scope
   33 |                                 if(s[k] == '?'){
      |                                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxx = 1e5 + 7;
const int Inf = 1 << 30;
char s[55], t[55];

int main() {
	scanf("%s %s", s, t);
	int ls = strlen(s), lt = strlen(t);
	int pos = Inf;
	for(int i = 0; i < ls; i++) {
		int cnt = 0, dd = 0;
		for(int j = i; j <= i + lt - 1; j++) {
			if(s[j] == '?' || s[j] == t[dd]) cnt++;
			dd++;
		}
		if(cnt == lt) pos = i;
	}
	if(pos == Inf) puts("UNRESTORABLE");
	else {
		dd = 0;
		for(int i = pos; i <= pos + lt - 1; i++) s[i] = t[dd++];
		for(int i = 0; i < ls; i++) if(s[i] == '?') s[i] = 'a';
		printf("%s\n", s);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: 'dd' was not declared in this scope
   22 |                 dd = 0;
      |                 ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
string s,t;
int main(){
  cin >> s >> t;
  if(s.size() < t.size()) cout << "UNRESTORABLE" << endl;

  int cost,cost_min = INF;
  string str="A",str_max;
  for(int i=0;i<s.size();i++){
    if(i==0) str_max = 'z';
    str_max+='z';
  }

  int t_head,head;
  bool set;
  for(int i=s.size()-t.size();i>=0;i--){
    set = true;
    for(int j=0;j<t.size();j++){
      if(s[i+j] == '?') continue;
      if(s[i+j] == t[j]) continue;
      else{ set = false; break; }
    }
    if(set){
      head = i;
      cost = 0;
      for(int j=0;j<s.size();j++){
        if(head <= j && j < head + t.size()){
          if(j==0) str = t[0];
          else str += t[j-head];
        }else if(s[j] == '?'){
          if(j==0) str = "a";
          else str += "a";
        }else{
          if(j==0) str = s[j];
          else str += s[j];
        }
      }
      if(str < str_max) str_max = str;
    }
  }
  if(str != "A") cout << str_max << endl;
  else cout << "UNRESTORABLE" << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:23: error: 'INF' was not declared in this scope
    8 |   int cost,cost_min = INF;
      |                       ^~~
Language: C++

s = input()
t = input()

if len(t)>len(s):
  print("UNRESTORABLE")
  exit()

ans = []

for i in range(len(s)-len(t)+1):
  for j in range(len(t)):
    if s[i+j] != t[j] and s[i+j]!='?':
      break
  else:
    ans.append((s[:i]+t+s[i+len(t):]).replace('?','a'))

if len(ans) == 0:
  print('UNRESTORABLE')
else:
  ans.sort()
  print(ans[0])


Compiler output:
a.cc:18:9: warning: multi-character literal with 12 characters exceeds 'int' size of 4 bytes
   18 |   print('UNRESTORABLE')
      |         ^~~~~~~~~~~~~~
a.cc:1:1: error: 's' does not name a type
    1 | s = input()
      | ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstring>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#define INF (long)1e9
const int MOD = 1e9 + 7;
const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, 1, -1};
using namespace std;
typedef long long ll;
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s, t;
	cin >> s >> t;
	bool flag = false;
	for(int i = 0; i < s.size(); i++)
	{
		if(i + t.size() > s.size()) continue;
		//string tmp = s.substr(i, t.size());
		cout << s.substr(i, t.size()) << endl;
		if(tmp.size() == t.size())
		{
			bool ok = true;
			for(int j = 0; j < tmp.size(); j++)
			{
				if(tmp[j] != t[j] && tmp[j] != '?')
					ok = false;
			}
			if(ok)
			{
				s.replace(i, t.size(), t);
				flag = true;
			}
		}
	}
	if(flag)
	{
		for(int i = 0; i < s.size(); i++)
		{
			if(s[i] == '?') s[i] = 'a';
			cout << s[i];
		}
		cout << endl;
	}
	else	
		cout << "UNRESTORABLE" << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:20: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   29 |                 if(tmp.size() == t.size())
      |                    ^~~
      |                    tm
Language: Java

import java.util.*;

public class C {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        int N = S.length();
        String T = sc.next();
        int M = T.length();

        String NOT = "UNRESTORABLE";

        if (M > N) {
            System.out.println(NOT);
            return;
        }

        NEXT: for (int i = 0; i <= N - M; i++) {
            int end = N - 1 - i;
            for (int j = 0; j < M; j++) {
                if (S.charAt(end - j) == '?' || S.charAt(end - j) == T.charAt(M - 1 - j)) continue;
                continue NEXT;
            }

            StringBuilder sb = new StringBuilder();
            for (int k = 0; k < N; k++) {
                if (k <= end && k >= end - M + 1) {
                    sb.append(T.charAt(k - (end - M + 1)));
                } else {
                    if (S.charAt(k) == '?') {
                        sb.append('a');
                    } else {
                        sb.append(S.charAt(k));
                    }
                }
            }
            System.out.println(sb.toString());
            return;
        }

        System.out.println(NOT);
    }
}

Compiler output:
Main.java:3: error: class C is public, should be declared in a file named C.java
public class C {
       ^
1 error
Language: C++

#include<iostream>
string s,n;
cin>>s>>n;
cout<<"UNRESTORABLE"<<endl;

Compiler output:
a.cc:2:1: error: 'string' does not name a type; did you mean 'stdin'?
    2 | string s,n;
      | ^~~~~~
      | stdin
a.cc:3:1: error: 'cin' does not name a type
    3 | cin>>s>>n;
      | ^~~
a.cc:4:1: error: 'cout' does not name a type
    4 | cout<<"UNRESTORABLE"<<endl;
      | ^~~~
Language: C++

string s,n;
cin>>s>>n;
cout<<"UNRESTORABLE"<<endl;

Compiler output:
a.cc:1:1: error: 'string' does not name a type
    1 | string s,n;
      | ^~~~~~
a.cc:2:1: error: 'cin' does not name a type
    2 | cin>>s>>n;
      | ^~~
a.cc:3:1: error: 'cout' does not name a type
    3 | cout<<"UNRESTORABLE"<<endl;
      | ^~~~