Language: C++

#include<cstdio>
char s[5];
int main ()
{
	scanf ("%s", &s);
	int a = s[0] - ’0 ’ , b = s[1] - ’0 ’ , c = s[2] - ’0 ’ , d = s[3] - ’0 ’;
	if (a -b -c - d ==7) printf ("%d-%d-%d-%d=7\n" ,a ,b ,c , d );
	else if (a -b - c + d ==7) printf ("%d-%d-%d+%d=7\n",a ,b ,c , d );
	else if (a - b +c - d ==7) printf ("%d-%d+%d-%d=7\n ",a ,b ,c , d );
	else if (a - b + c + d ==7) printf ("%d-%d+%d+%d=7\n" ,a ,b ,c , d );
	else if ( a +b -c - d ==7) printf ("%d+%d-%d-%d=7\n" ,a ,b ,c , d );
	else if ( a +b - c + d ==7) printf ("%d+%d-%d+%d=7\n" ,a ,b ,c , d );
	else if ( a + b +c - d ==7) printf ("%d+%d+%d-%d=7\n" ,a ,b ,c , d );
	else if ( a + b + c + d ==7) printf ("%d+%d+%d+%d=7\n " ,a ,b ,c , d );
}

Compiler output:
a.cc:6:24: error: extended character ’ is not valid in an identifier
    6 |         int a = s[0] - ’0 ’ , b = s[1] - ’0 ’ , c = s[2] - ’0 ’ , d = s[3] - ’0 ’;
      |                        ^
a.cc:6:27: error: extended character ’ is not valid in an identifier
    6 |         int a = s[0] - ’0 ’ , b = s[1] - ’0 ’ , c = s[2] - ’0 ’ , d = s[3] - ’0 ’;
      |                           ^
a.cc:6:42: error: extended character ’ is not valid in an identifier
    6 |         int a = s[0] - ’0 ’ , b = s[1] - ’0 ’ , c = s[2] - ’0 ’ , d = s[3] - ’0 ’;
      |                                          ^
a.cc:6:45: error: extended character ’ is not valid in an identifier
    6 |         int a = s[0] - ’0 ’ , b = s[1] - ’0 ’ , c = s[2] - ’0 ’ , d = s[3] - ’0 ’;
      |                                             ^
a.cc:6:60: error: extended character ’ is not valid in an identifier
    6 |         int a = s[0] - ’0 ’ , b = s[1] - ’0 ’ , c = s[2] - ’0 ’ , d = s[3] - ’0 ’;
      |                                                            ^
a.cc:6:63: error: extended character ’ is not valid in an identifier
    6 |         int a = s[0] - ’0 ’ , b = s[1] - ’0 ’ , c = s[2] - ’0 ’ , d = s[3] - ’0 ’;
      |                                                               ^
a.cc:6:78: error: extended character ’ is not valid in an identifier
    6 |         int a = s[0] - ’0 ’ , b = s[1] - ’0 ’ , c = s[2] - ’0 ’ , d = s[3] - ’0 ’;
      |                                                                              ^
a.cc:6:81: error: extended character ’ is not valid in an identifier
    6 |         int a = s[0] - ’0 ’ , b = s[1] - ’0 ’ , c = s[2] - ’0 ’ , d = s[3] - ’0 ’;
      |                                                                                 ^
a.cc: In function 'int main()':
a.cc:6:24: error: '\U000020190' was not declared in this scope
    6 |         int a = s[0] - ’0 ’ , b = s[1] - ’0 ’ , c = s[2] - ’0 ’ , d = s[3] - ’0 ’;
      |                        ^~
a.cc:7:16: error: 'b' was not declared in this scope
    7 |         if (a -b -c - d ==7) printf ("%d-%d-%d-%d=7\n" ,a ,b ,c , d );
      |                ^
a.cc:7:19: error: 'c' was not declared in this scope
    7 |         if (a -b -c - d ==7) printf ("%d-%d-%d-%d=7\n" ,a ,b ,c , d );
      |                   ^
a.cc:7:23: error: 'd' was not declared in this scope
    7 |         if (a -b -c - d ==7) printf ("%d-%d-%d-%d=7\n" ,a ,b ,c , d );
      |                       ^