Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
int s;
  cin>>s;
  int a=s%10;
  int A=(s-a)/10;
  int b=A%10;
  int B=(A-b)/10;
  int c=B%10;
  int C=(B-c)%10;
  int d=C%10;
  
  if(a+b+c+d==7) cout<<a+'+'+b+'+'+c+'+'+d+'='+7<<endl;
  else if(a+b+c-d==7) cout<<a+"+"+b+"+"+c+"-"+d+"="+7<<endl;
  else if(a+b-c-d==7) cout<<a+"+"+b+"-"+c+"-"+d+"="+7<<endl;
  else if(a+b-c+d==7) cout<<a+"+"+b+"-"+c+"+"+d+"="+7<<endl;
  else if(a-b+c+d==7) cout<<a+"-"+b+"+"+c+"+"+d+"="+7<<endl;
  else if(a-b+c-d==7) cout<<a+"-"+b+"+"+c+"-"+d+"="+7<<endl;
  else if(a-b-c-d==7) cout<<a+"-"+b+"-"+c+"-"+d+"="+7<<endl;
  else if(a-b-c+d==7) cout<<a+"-"+b+"-"+c+"+"+d+"="+7<<endl;
}
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:15:36: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   15 |   else if(a+b+c-d==7) cout<<a+"+"+b+"+"+c+"-"+d+"="+7<<endl;
      |                             ~~~~~~~^~~~
      |                                  |  |
      |                                  |  const char [2]
      |                                  const char*
a.cc:16:36: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   16 |   else if(a+b-c-d==7) cout<<a+"+"+b+"-"+c+"-"+d+"="+7<<endl;
      |                             ~~~~~~~^~~~
      |                                  |  |
      |                                  |  const char [2]
      |                                  const char*
a.cc:17:36: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   17 |   else if(a+b-c+d==7) cout<<a+"+"+b+"-"+c+"+"+d+"="+7<<endl;
      |                             ~~~~~~~^~~~
      |                                  |  |
      |                                  |  const char [2]
      |                                  const char*
a.cc:18:36: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   18 |   else if(a-b+c+d==7) cout<<a+"-"+b+"+"+c+"+"+d+"="+7<<endl;
      |                             ~~~~~~~^~~~
      |                                  |  |
      |                                  |  const char [2]
      |                                  const char*
a.cc:19:36: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   19 |   else if(a-b+c-d==7) cout<<a+"-"+b+"+"+c+"-"+d+"="+7<<endl;
      |                             ~~~~~~~^~~~
      |                                  |  |
      |                                  |  const char [2]
      |                                  const char*
a.cc:20:36: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   20 |   else if(a-b-c-d==7) cout<<a+"-"+b+"-"+c+"-"+d+"="+7<<endl;
      |                             ~~~~~~~^~~~
      |                                  |  |
      |                                  |  const char [2]
      |                                  const char*
a.cc:21:36: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   21 |   else if(a-b-c+d==7) cout<<a+"-"+b+"-"+c+"+"+d+"="+7<<endl;
      |                             ~~~~~~~^~~~
      |                                  |  |
      |                                  |  const char [2]
      |                                  const char*