Language: C++

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

int main(){
    string s;
    cin >> s;
    int a = atoi(s[0]), b = atoi(s[1]), c = atoi(s[2]), d = atoi(s[3]);
    if(a+b+c+d == 7){
        cout << a << '+' << b << '+' << c << '+' << d << "=7";
    }else if(a+b+c-d == 7){
        cout << a << '+' << b << '+' << c << '-' << d << "=7";
    }else if(a+b-c+d == 7){
        cout << a << '+' << b << '-' << c << '+' << d << "=7";
    }else if(a+b-c-d == 7){
        cout << a << '+' << b << '-' << c << '-' << d << "=7";
    }else if(a-b+c+d == 7){
        cout << a << '-' << b << '+' << c << '+' << d << "=7";
    }else if(a-b+c-d == 7){
        cout << a << '-' << b << '+' << c << '-' << d << "=7";
    }else if(a-b-c+d == 7){
        cout << a << '-' << b << '-' << c << '+' << d << "=7";
    }else{
        cout << a << '-' << b << '-' << c << '-' << d << "=7";
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
    7 |     int 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/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 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:7:33: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
    7 |     int 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:7:49: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
    7 |     int 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:7:65: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
    7 |     int 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)
      |                  ~~~~~~~~~~~~^~~~~~