Language: C++

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

int main() {
  string a,b,c;
  cin>>a>>b>>c;
  int s=0;
  int t=0;
  int u=0;
  int v=0;
  int w=0;
  int x=0;
  for(int i=0;i<max(c.size(),max(a.size(),b.size()));i++){
    if(a.at(a.size()-1-i)==b.at(i)||a.at(a.size()-1-i)=="?"||b.at(i)=="?"){
      s++;
    }
    if(b.at(b.size()-1-i)==c.at(i)||b.at(b.size()-1-i)=="?"||c.at(i)=="?"){
      t++;
    }
    if(c.at(c.size()-1-i)==a.at(i)||c.at(c.size()-1-i)=="?"||a.at(i)=="?"){
      u++;
    }
    if(a.at(a.size()-1-i)==c.at(i)||a.at(a.size()-1-i)=="?"||c.at(i)=="?"){
      v++;
    }
    if(b.at(b.size()-1-i)==a.at(i)||b.at(b.size()-1-i)=="?"||a.at(i)=="?"){
      w++;
    }
    if(c.at(c.size()-1-i)==b.at(i)||c.at(c.size()-1-i)=="?"||b.at(i)=="?"){
      x++;
    }
      cout<<a.size()+b.size()+c.size()-max(s+t,max(v+x,max(w+v,max(t+u,max(u+s,x+w)))));
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:55: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     if(a.at(a.size()-1-i)==b.at(i)||a.at(a.size()-1-i)=="?"||b.at(i)=="?"){
      |                                     ~~~~~~~~~~~~~~~~~~^~~~~
a.cc:14:69: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   14 |     if(a.at(a.size()-1-i)==b.at(i)||a.at(a.size()-1-i)=="?"||b.at(i)=="?"){
      |                                                              ~~~~~~~^~~~~
a.cc:17:55: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |     if(b.at(b.size()-1-i)==c.at(i)||b.at(b.size()-1-i)=="?"||c.at(i)=="?"){
      |                                     ~~~~~~~~~~~~~~~~~~^~~~~
a.cc:17:69: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |     if(b.at(b.size()-1-i)==c.at(i)||b.at(b.size()-1-i)=="?"||c.at(i)=="?"){
      |                                                              ~~~~~~~^~~~~
a.cc:20:55: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   20 |     if(c.at(c.size()-1-i)==a.at(i)||c.at(c.size()-1-i)=="?"||a.at(i)=="?"){
      |                                     ~~~~~~~~~~~~~~~~~~^~~~~
a.cc:20:69: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   20 |     if(c.at(c.size()-1-i)==a.at(i)||c.at(c.size()-1-i)=="?"||a.at(i)=="?"){
      |                                                              ~~~~~~~^~~~~
a.cc:23:55: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   23 |     if(a.at(a.size()-1-i)==c.at(i)||a.at(a.size()-1-i)=="?"||c.at(i)=="?"){
      |                                     ~~~~~~~~~~~~~~~~~~^~~~~
a.cc:23:69: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   23 |     if(a.at(a.size()-1-i)==c.at(i)||a.at(a.size()-1-i)=="?"||c.at(i)=="?"){
      |                                                              ~~~~~~~^~~~~
a.cc:26:55: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   26 |     if(b.at(b.size()-1-i)==a.at(i)||b.at(b.size()-1-i)=="?"||a.at(i)=="?"){
      |                                     ~~~~~~~~~~~~~~~~~~^~~~~
a.cc:26:69: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   26 |     if(b.at(b.size()-1-i)==a.at(i)||b.at(b.size()-1-i)=="?"||a.at(i)=="?"){
      |                                                              ~~~~~~~^~~~~
a.cc:29:55: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   29 |     if(c.at(c.size()-1-i)==b.at(i)||c.at(c.size()-1-i)=="?"||b.at(i)=="?"){
      |                                     ~~~~~~~~~~~~~~~~~~^~~~~
a.cc:29:69: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   29 |     if(c.at(c.size()-1-i)==b.at(i)||c.at(c.size()-1-i)=="?"||b.at(i)=="?"){
      |                                                              ~~~~~~~^~~~~