Language: C++

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

int main() {
	int a, b, c, d, r1, r2, r3;
	string s, op[2] = {"+", "-"};
	cin >> s;
	a = atoi(s[0]); b = atoi(s[1]); c = atoi(s[2]); d = atoi(s[3]);
	for(int op1=0; op1<=1; op1++){
		if(op1 == 0) r1=a+b;
		else r1 = a-b;
		for(int op2=0;op2<=1;op2++){
			if(op2 == 0) r2 = r1+c;
			else r3 = r1-c;
			for(int op3=0; op3<=1; op3++) {
				if(op3 == 0) r3 = r2 + d;
				else r3 = r2 - d;
				if(r3 == 7) {
				cout << a << op[op1] << b << op[op2] << c << op[op3] << d << "=7" << endl;	
				}
			}
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
    9 |         a = atoi(s[0]); b = atoi(s[1]); c = atoi(s[2]); d = atoi(s[3]);
      |             ~~~~^~~~~~
      |                 |
      |                 __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:9:33: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
    9 |         a = atoi(s[0]); b = atoi(s[1]); c = atoi(s[2]); d = atoi(s[3]);
      |                             ~~~~^~~~~~
      |                                 |
      |                                 __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:9:49: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
    9 |         a = atoi(s[0]); b = atoi(s[1]); c = atoi(s[2]); d = atoi(s[3]);
      |                                             ~~~~^~~~~~
      |                                                 |
      |                                                 __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:9:65: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
    9 |         a = atoi(s[0]); b = atoi(s[1]); c = atoi(s[2]); d = atoi(s[3]);
      |                                                             ~~~~^~~~~~
      |                                                                 |
      |                                                                 __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~