Language: C++

/// Bismillah Hir Rahmanir Rahim

/**
    Practice like Cristiano Ronaldo
        Play Like Leo Messi..
**/

#include <bits/stdc++.h>

using namespace std;

#define PI                    acos(-1.0)
#define Pi                    3.141592653589793
#define ff                    first
#define ss                    second
#define pb                    push_back
#define space                 " "
#define all(x)                (x).begin(), (x).end()
#define clr(ar)               memset(ar, 0, sizeof(ar))
#define eprintf(...)          fprintf(stderr, __VA_ARGS__)

/*
template <class T> T gcd(T a,T b){ if(b == 0) return a; return gcd( b,a % b ); }
template <class T> T lcm(T a, T b ){ return ( a * b ) / gcd( a,b ); }
template<class T> string ToString(const T &x){ stringstream s; s << x; return s.str(); }
template<class T> int ToInteger(const T &x){ stringstream s; s << x; int r; s >> r; return r; }
*/

typedef  long long int            ll;
typedef  map<string,int>          msi;
typedef  map<int,int>	          mii;
typedef  map<char,int>            mci;
typedef  map<int,string>	      mis;
typedef  pair<int,int> 	          ii;
typedef  pair<string, int>        psi;
typedef  vector<int> 	          vi;
typedef  vector<string> 	      vs;
typedef  vector< ii >             vii;

template<class T1> void deb(T1 e1)
{
    cout << e1 << endl;
}
template<class T1,class T2> void deb(T1 e1, T2 e2)
{
    cout << e1 << space << e2 << endl;
}
template<class T1,class T2,class T3> void deb(T1 e1, T2 e2, T3 e3)
{
    cout << e1 << space << e2 << space << e3 << endl;
}

#define sf                    scanf
#define pf                    printf

#define sf1(a)                scanf("%d", &a)
#define sf2(a,b)              scanf("%d %d",&a, &b)
#define sf3(a,b,c)            scanf("%d %d %d", &a, &b, &c)
#define sf4(a,b,c,d)          scanf("%d %d %d %d", &a, &b, &c, &d)

#define sf1ll(a)              scanf("%I64d", &a)
#define sf2ll(a,b)            scanf("%I64d %I64d", &a, &b)
#define sf3ll(a,b,c)          scanf("%I64d %I64d %I64d", &a, &b, &c)
#define sf4ll(a,b,c,d)        scanf("%I64d %I64d %I64d %I64d", &a, &b, &c, &d)

#define READ                  freopen("in.txt", "r", stdin);
#define WRITE                 freopen("out.txt", "w", stdout);
/// The End.

void check_time()
{
#ifdef the_badcoder
    eprintf("%.5lf\n", (double)clock() / CLOCKS_PER_SEC);
#endif
}

const int res = 1e5 + 10;
const ll mod = 1e9 + 7;


int main()
{
    int n, sum, total, a, b, c, d;
    string s, ch;

    cin >> s;

    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 );




    return 0;
}


Compiler output:
a.cc:89:21: error: extended character ’ is not valid in an identifier
   89 |     int a = s [0] - ’0 ’ , b = s [1] - ’0 ’ , c = s [2] - ’0 ’ , d = s [3] - ’0 ’;
      |                     ^
a.cc:89:24: error: extended character ’ is not valid in an identifier
   89 |     int a = s [0] - ’0 ’ , b = s [1] - ’0 ’ , c = s [2] - ’0 ’ , d = s [3] - ’0 ’;
      |                        ^
a.cc:89:40: error: extended character ’ is not valid in an identifier
   89 |     int a = s [0] - ’0 ’ , b = s [1] - ’0 ’ , c = s [2] - ’0 ’ , d = s [3] - ’0 ’;
      |                                        ^
a.cc:89:43: error: extended character ’ is not valid in an identifier
   89 |     int a = s [0] - ’0 ’ , b = s [1] - ’0 ’ , c = s [2] - ’0 ’ , d = s [3] - ’0 ’;
      |                                           ^
a.cc:89:59: error: extended character ’ is not valid in an identifier
   89 |     int a = s [0] - ’0 ’ , b = s [1] - ’0 ’ , c = s [2] - ’0 ’ , d = s [3] - ’0 ’;
      |                                                           ^
a.cc:89:62: error: extended character ’ is not valid in an identifier
   89 |     int a = s [0] - ’0 ’ , b = s [1] - ’0 ’ , c = s [2] - ’0 ’ , d = s [3] - ’0 ’;
      |                                                              ^
a.cc:89:78: error: extended character ’ is not valid in an identifier
   89 |     int a = s [0] - ’0 ’ , b = s [1] - ’0 ’ , c = s [2] - ’0 ’ , d = s [3] - ’0 ’;
      |                                                                              ^
a.cc:89:81: error: extended character ’ is not valid in an identifier
   89 |     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:89:9: error: redeclaration of 'int a'
   89 |     int a = s [0] - ’0 ’ , b = s [1] - ’0 ’ , c = s [2] - ’0 ’ , d = s [3] - ’0 ’;
      |         ^
a.cc:83:24: note: 'int a' previously declared here
   83 |     int n, sum, total, a, b, c, d;
      |                        ^
a.cc:89:21: error: '\U000020190' was not declared in this scope
   89 |     int a = s [0] - ’0 ’ , b = s [1] - ’0 ’ , c = s [2] - ’0 ’ , d = s [3] - ’0 ’;
      |                     ^~
a.cc:90:34: warning: unknown escape sequence: '\040'
   90 |     if (a -b -c - d ==7) printf ("% d -% d -% d -% d =7\ n " ,a ,b ,c , d );
      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:91:40: warning: unknown escape sequence: '\040'
   91 |     else if (a -b - c + d ==7) printf ("% d -% d -% d +% d =7\ n " ,a ,b ,c , d );
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:92:40: warning: unknown escape sequence: '\040'
   92 |     else if (a - b +c - d ==7) printf ("% d -% d +% d -% d =7\ n " ,a ,b ,c , d );
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:93:41: warning: unknown escape sequence: '\040'
   93 |     else if (a - b + c + d ==7) printf ("% d -% d +% d +% d =7\ n " ,a ,b ,c , d );
      |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:94:40: warning: unknown escape sequence: '\040'
   94 |     else if ( a +b -c - d ==7) printf ("% d +% d -% d -% d =7\ n " ,a ,b ,c , d );
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:95:41: warning: unknown escape sequence: '\040'
   95 |     else if ( a +b - c + d ==7) printf ("% d +% d -% d +% d =7\ n " ,a ,b ,c , d );
      |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:96:41: warning: unknown escape sequence: '\040'
   96 |     else if ( a + b +c - d ==7) printf ("% d +% d +% d -% d =7\ n " ,a ,b ,c , d );
      |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:97:42: warning: unknown escape sequence: '\040'
   97 |     else if ( a + b + c + d ==7) printf ("% d +% d +% d +% d =7\ n " ,a ,b ,c , d );
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~