Language: C++

#include<iostream>
#include<sstream>
using namespace std;
int a,b,c,d;
char e, f, g, h;
string ans;
void sum(int x, char y, int z) {





}
int main() {
	stringstream ss1, ss2, ss3, ss4;
	ss1 << a;
	ss1 >> e;
	ss1 << b;
	ss1 >> f;
	ss1 << g;
	ss1 >> e;
	ss1 << d;
	ss1 >> h;
	cin >> a>>b>>c>>d;
	if (a + b + c + d == 7) {
		ans = e + "+" + f + "+" + g + "+" + h + "=7";
	}
	if (a - b + c + d == 7) {
		ans = e + "-" + f + "+" + g + "+" + h + "=7";
	}
	if (a + b - c + d == 7) {
		ans = e + "+" + f + "-" + g + "+" + h + "=7";
	}
	if (a + b + c - d == 7) {
		ans = e + "+" + f + "+" + g + "-" + h + "=7";
	}
	if (a - b - c + d == 7) {
		ans = e + "-" + f + "-" + g + "+" + h + "=7";
	}
	if (a + b - c - d == 7) {
		ans = e + "+" + f + "-" + g + "-" + h + "=7";
	}
	if (a - b + c - d == 7) {
		ans = e + "-" + f + "+" + g + "-" + h + "=7";
	}
	if (a - b - c - d == 7) {
		ans = e + "-" + f + "-" + g + "-" + h + "=7";
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:35: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   26 |                 ans = e + "+" + f + "+" + g + "+" + h + "=7";
      |                       ~~~~~~~~~~~ ^ ~~~
      |                               |     |
      |                               |     const char [2]
      |                               const char*
a.cc:29:35: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   29 |                 ans = e + "-" + f + "+" + g + "+" + h + "=7";
      |                       ~~~~~~~~~~~ ^ ~~~
      |                               |     |
      |                               |     const char [2]
      |                               const char*
a.cc:32:35: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   32 |                 ans = e + "+" + f + "-" + g + "+" + h + "=7";
      |                       ~~~~~~~~~~~ ^ ~~~
      |                               |     |
      |                               |     const char [2]
      |                               const char*
a.cc:35:35: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   35 |                 ans = e + "+" + f + "+" + g + "-" + h + "=7";
      |                       ~~~~~~~~~~~ ^ ~~~
      |                               |     |
      |                               |     const char [2]
      |                               const char*
a.cc:38:35: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   38 |                 ans = e + "-" + f + "-" + g + "+" + h + "=7";
      |                       ~~~~~~~~~~~ ^ ~~~
      |                               |     |
      |                               |     const char [2]
      |                               const char*
a.cc:41:35: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   41 |                 ans = e + "+" + f + "-" + g + "-" + h + "=7";
      |                       ~~~~~~~~~~~ ^ ~~~
      |                               |     |
      |                               |     const char [2]
      |                               const char*
a.cc:44:35: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   44 |                 ans = e + "-" + f + "+" + g + "-" + h + "=7";
      |                       ~~~~~~~~~~~ ^ ~~~
      |                               |     |
      |                               |     const char [2]
      |                               const char*
a.cc:47:35: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   47 |                 ans = e + "-" + f + "-" + g + "-" + h + "=7";
      |                       ~~~~~~~~~~~ ^ ~~~
      |                               |     |
      |                               |     const char [2]
      |                               const char*