criyle/codenet-compile-errors huggingface dataset:
Language: C

#include<stdio.h>

int main()
{
	char a1,b1,c1,d1;
	int a,b,c,d;
	int m=0;
	scanf("%c%c%c%c",&a1,&b1,&c1,&d1);
	a=(int)(a1-'0');
	b=(int)(b1-'0');
	c=(int)(c1-'0');
	d=(int)(d1-'0');
	if (a+b+c+d==7) t=1;
	else if (a+b+c-d==7) t=2;
	else if (a+b-c+d==7) t=3;
	else if (a-b+c+d==7) t=4;
	else if (a+b-c-d==7) t=5;
	else if (a-b+c-d==7) t=6;
	else if (a-b-c+d==7) t=7;
	else if (a-b-c-d==7) t=8;
	
	switch(m){
	case 1:	printf("%d+%d+%d+%d=7",a,b,c,d);break;
	case 2:	printf("%d+%d+%d-%d=7",a,b,c,d);break;
	case 3:	printf("%d+%d-%d+%d=7",a,b,c,d);break;
	case 4:	printf("%d-%d+%d+%d=7",a,b,c,d);break;
	case 5:	printf("%d+%d-%d-%d=7",a,b,c,d);break;
	case 6:	printf("%d-%d+%d-%d=7",a,b,c,d);break;
	case 7:	printf("%d-%d-%d+%d=7",a,b,c,d);break;
	case 8:	printf("%d-%d-%d-%d=7",a,b,c,d);break;
	default:printf("no answer!");break;
	}
}

Compiler output:
main.c: In function 'main':
main.c:13:25: error: 't' undeclared (first use in this function)
   13 |         if (a+b+c+d==7) t=1;
      |                         ^
main.c:13:25: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<iostream>
using namespace std;

const char q='+';
const char w='-';
const char e='=';
const int r=7;

int max(int a,int b)
{
	if(a>b)return a;
	else return b;
}

int main()
{
	int a,b,c,d,m,i;
	cin>>m;
	d=m%10;
	c=m/10%10;
	b=m/100%10;
	a=m/1000;
	i=max(max(a,b),max(c,d));
	if(i==a)
	{
		if(a+b+c+d==7){cout<<a<<q<<b<<q<<c<<q<<d<<e<<r<<endl;}
		else if(a+b+c-d==7){cout<<a<<q<<b<<q<<c<<w<<d<<e<<r<<endl;}
		else if(a+b-c+d==7){cout<<a<<q<<b<<w<<c<<q<<d<<e<<r<<endl;}
		else if(a+b-c-d==7){cout<<a<<q<<b<<w<<c<<w<<d<<e<<r<<endl;}
		else if(a-b+c+d==7){cout<<a<<w<<b<<q<<c<<q<<d<<e<<r<<endl;}
		else if(a-b+c-d==7){cout<<a<<w<<b<<q<<c<<w<<d<<e<<r<<endl;}
		else if(a-b-c+d==7){cout<<a<<w<<b<<w<<c<<q<<d<<e<<r<<endl;}
		else if(a-b-c-d==7){cout<<a<<w<<b<<w<<c<<w<<d<<e<<r<<endl;}
	}
	else if(i==b)
	{
		if(a+b+c+d==7){cout<<a<<q<<b<<q<<c<<q<<d<<e<<r<<endl;}
		else if(a+b+c-d==7){cout<<a<<q<<b<<q<<c<<w<<d<<e<<r<<endl;}
		else if(a+b-c+d==7){cout<<a<<q<<b<<w<<c<<q<<d<<e<<r<<endl;}
		else if(a+b-c-d==7){cout<<a<<q<<b<<w<<c<<w<<d<<e<<r<<endl;}
		else if(a+b+c+d==7){cout<<a<<q<<b<<q<<c<<q<<d<<e<<r<<endl;}
		else if(a+b+c-d==7){cout<<a<<q<<b<<q<<c<<w<<d<<e<<r<<endl;}
		else if(a+b-c+d==7){cout<<a<<q<<b<<w<<c<<q<<d<<e<<r<<endl;}
		else if(a+b-c-d==7){cout<<a<<q<<b<<w<<c<<w<<d<<e<<r<<endl;}
	}
	else if(i==c)
	{
		if(a+b+c+d==7){cout<<a<<q<<b<<q<<c<<q<<d<<e<<r<<endl;}
		else if(a+b+c-d==7){cout<<a<<q<<b<<q<<c<<w<<d<<e<<r<<endl;}
		else if(a+b+c+d==7){cout<<a<<q<<b<<q<<c<<q<<d<<e<<r<<endl;}
		else if(a+b+c-d==7){cout<<a<<q<<b<<q<<c<<w<<d<<e<<r<<endl;}
		else if(a-b+c+d==7){cout<<a<<w<<b<<q<<c<<q<<d<<e<<r<<endl;}
		else if(a-b+c-d==7){cout<<a<<w<<b<<q<<c<<w<<d<<e<<r<<endl;}
		else if(a-b+c+d==7){cout<<a<<w<<b<<q<<c<<q<<d<<e<<r<<endl;}
		else if(a-b+c-d==7){cout<<a<<w<<b<<q<<c<<w<<d<<e<<r<<endl;}
	}
	else if(i==d)
	{
		if(a+b+c+d==7){cout<<a<<q<<b<<q<<c<<q<<d<<e<<r<<endl;}
		else if(a+b+c+d==7){cout<<a<<q<<b<<q<<c<<q<<d<<e<<r<<endl;}
		else if(a+b-c+d==7){cout<<a<<q<<b<<w<<c<<q<<d<<e<<r<<endl;}
		else if(a+b-c+d==7){cout<<a<<q<<b<<w<<c<<q<<d<<e<<r<<endl;}
		else if(a-b+c+d==7){cout<<a<<w<<b<<q<<c<<q<<d<<e<<r<<endl;}
		else if(a-b+c+d==7){cout<<a<<w<<b<<q<<c<<q<<d<<e<<r<<endl;}
		else if(a-b-c+d==7){cout<<a<<w<<b<<w<<c<<q<<d<<e<<r<<endl;}
		else if(a-b-c+d==7){cout<<a<<w<<b<<w<<c<<q<<d<<e<<r<<endl;}
	}
}

列表最帅 2018/3/13 20:41:25


Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
using namespace std;

const char q='+';
const char w='-';
const char e='=';
const int r=7;

int max(int a,int b)
{
	if(a>b)return a;
	else return b;
}

int main()
{
	int a,b,c,d,m,i;
	cin>>m;
	d=m%10;
	c=m/10%10;
	b=m/100%10;
	a=m/1000;
	i=max(max(a,b),max(c,d));
	if(i==a)
	{
		if(a+b+c+d==7){cout<<a<<q<<b<<q<<c<<q<<d<<e<<r<<endl;}
		else if(a+b+c-d==7){cout<<a<<q<<b<<q<<c<<w<<d<<e<<r<<endl;}
		else if(a+b-c+d==7){cout<<a<<q<<b<<w<<c<<q<<d<<e<<r<<endl;}
		else if(a+b-c-d==7){cout<<a<<q<<b<<w<<c<<w<<d<<e<<r<<endl;}
		else if(a-b+c+d==7){cout<<a<<w<<b<<q<<c<<q<<d<<e<<r<<endl;}
		else if(a-b+c-d==7){cout<<a<<w<<b<<q<<c<<w<<d<<e<<r<<endl;}
		else if(a-b-c+d==7){cout<<a<<w<<b<<w<<c<<q<<d<<e<<r<<endl;}
		else if(a-b-c-d==7){cout<<a<<w<<b<<w<<c<<w<<d<<e<<r<<endl;}
	}
	else if(i==b)
	{
		if(a+b+c+d==7){cout<<a<<q<<b<<q<<c<<q<<d<<e<<r<<endl;}
		else if(a+b+c-d==7){cout<<a<<q<<b<<q<<c<<w<<d<<e<<r<<endl;}
		else if(a+b-c+d==7){cout<<a<<q<<b<<w<<c<<q<<d<<e<<r<<endl;}
		else if(a+b-c-d==7){cout<<a<<q<<b<<w<<c<<w<<d<<e<<r<<endl;}
		else if(a+b+c+d==7){cout<<a<<q<<b<<q<<c<<q<<d<<e<<r<<endl;}
		else if(a+b+c-d==7){cout<<a<<q<<b<<q<<c<<w<<d<<e<<r<<endl;}
		else if(a+b-c+d==7){cout<<a<<q<<b<<w<<c<<q<<d<<e<<r<<endl;}
		else if(a+b-c-d==7){cout<<a<<q<<b<<w<<c<<w<<d<<e<<r<<endl;}
	}
	else if(i==c)
	{
		if(a+b+c+d==7){cout<<a<<q<<b<<q<<c<<q<<d<<e<<r<<endl;}
		else if(a+b+c-d==7){cout<<a<<q<<b<<q<<c<<w<<d<<e<<r<<endl;}
		else if(a+b+c+d==7){cout<<a<<q<<b<<q<<c<<q<<d<<e<<r<<endl;}
		else if(a+b+c-d==7){cout<<a<<q<<b<<q<<c<<w<<d<<e<<r<<endl;}
		else if(a-b+c+d==7){cout<<a<<w<<b<<q<<c<<q<<d<<e<<r<<endl;}
		else if(a-b+c-d==7){cout<<a<<w<<b<<q<<c<<w<<d<<e<<r<<endl;}
		else if(a-b+c+d==7){cout<<a<<w<<b<<q<<c<<q<<d<<e<<r<<endl;}
		else if(a-b+c-d==7){cout<<a<<w<<b<<q<<c<<w<<d<<e<<r<<endl;}
	}
	else if(i==d)
	{
		if(a+b+c+d==7){cout<<a<<q<<b<<q<<c<<q<<d<<e<<r<<endl;}
		else if(a+b+c+d==7){cout<<a<<q<<b<<q<<c<<q<<d<<e<<r<<endl;}
		else if(a+b-c+d==7){cout<<a<<q<<b<<w<<c<<q<<d<<e<<r<<endl;}
		else if(a+b-c+d==7){cout<<a<<q<<b<<w<<c<<q<<d<<e<<r<<endl;}
		else if(a-b+c+d==7){cout<<a<<w<<b<<q<<c<<q<<d<<e<<r<<endl;}
		else if(a-b+c+d==7){cout<<a<<w<<b<<q<<c<<q<<d<<e<<r<<endl;}
		else if(a-b-c+d==7){cout<<a<<w<<b<<w<<c<<q<<d<<e<<r<<endl;}
		else if(a-b-c+d==7){cout<<a<<w<<b<<w<<c<<q<<d<<e<<r<<endl;}
	}
}

列表最帅 2018/3/13 20:41:25


Compiler output:
a.cc:70:1: error: '\U00005217\U00008868\U00006700\U00005e05' does not name a type
   70 | 列表最帅 2018/3/13 20:41:25
      | ^~~~~~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main() {
  int input;
  cin >> input;
  int nums[4];
  nums[0] = input / 1000;
  nums[1] = input / 100;
  nums[2] = input / 10;
  nums[3] = input / 1;
  int sum = nums[0]
  string str = "";
  int strategy = 0;
  for(int i = 0; i < 3; i++) {
    for(int j = 0; j < 2; j++) {
      if(j == 0) {
        strategy = strategy & 1 << i;
      } 
    }
    if(i == 2) {
      int sum = nums[0];
      string ans = "";
      ans += to_string(nums[0]);
      for(int k = 0; k < 3; k++) {
        if(strategy >> k & 1) {
          sum += nums[k+1];
          ans += "+"; 
        } else {
          sum -= nums[k+1];
          ans -= "-";
        }
        ans += to_string(nums[k + 1]);
      }
      if (sum == 7) {
        cout << ans << "=7" << endl;
        return 0;
      }
    }
    
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: expected ',' or ';' before 'string'
   15 |   string str = "";
      |   ^~~~~~
a.cc:33:15: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [2]')
   33 |           ans -= "-";
      |           ~~~~^~~~~~
Language: C++

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

int main() {
  int input;
  cin >> input;
  vector<int> nums;
  nums.resize(4);
  nums[0] = input / 1000;
  nums[1] = input / 100;
  nums[2] = input / 10;
  nums[3] = input / 1;
  int sum = nums[0]
  string str = "";
  int strategy = 0;
  for(int i = 0; i < 3; i++) {
    for(int j = 0; j < 2; j++) {
      if(j == 0) {
        strategy = strategy & 1 << i;
      } 
    }
    if(i == 2) {
      int sum = nums[0];
      string ans = "";
      ans += to_string(nums[0]);
      for(int k = 0; k < 3; k++) {
        if(strategy >> k & 1) {
          sum += nums[k+1];
          ans += "+"; 
        } else {
          sum -= nums[k+1];
          ans -= "-";
        }
        ans += to_string(nums[k + 1]);
      }
      if (sum == 7) {
        cout << ans << "=7" << endl;
        return 0;
      }
    }
    
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> nums;
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | #include <string>
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> nums;
      |          ^~~
a.cc:9:3: error: 'nums' was not declared in this scope
    9 |   nums.resize(4);
      |   ^~~~
a.cc:33:15: error: no match for 'operator-=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'const char [2]')
   33 |           ans -= "-";
      |           ~~~~^~~~~~
Language: C

#include<stdio.h>
using namespace std;
int main()
{
		int a,b,c,d;
		cin>>a>>b>>c>>d;
 		if(a+b+c+d==7) cout<<a<<"+"<<b<<"+"<<c<<"+"<<d<<"="<<7<<endl;
		if(a-b+c+d==7) cout<<a<<"-"<<b<<"+"<<c<<"+"<<d<<"="<<7<<endl;
		if(a+b-c+d==7) cout<<a<<"+"<<b<<"-"<<c<<"+"<<d<<"="<<7<<endl;
		if(a+b+c-d==7) cout<<a<<"+"<<b<<"+"<<c<<"-"<<d<<"="<<7<<endl;
		if(a+b-c-d==7) cout<<a<<"+"<<b<<"-"<<c<<"-"<<d<<"="<<7<<endl;
		if(a-b-c-d==7) cout<<a<<"-"<<b<<"-"<<c<<"-"<<d<<"="<<7<<endl;
		if(a-b-c+d==7) cout<<a<<"-"<<b<<"-"<<c<<"+"<<d<<"="<<7<<endl;
		if(a-b+c-d==7) cout<<a<<"-"<<b<<"+"<<c<<"-"<<d<<"="<<7<<endl;
	return 0;
}

Compiler output:
main.c:2:1: error: unknown type name 'using'
    2 | using namespace std;
      | ^~~~~
main.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    2 | using namespace std;
      |                 ^~~
main.c: In function 'main':
main.c:6:17: error: 'cin' undeclared (first use in this function)
    6 |                 cin>>a>>b>>c>>d;
      |                 ^~~
main.c:6:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:32: error: 'cout' undeclared (first use in this function)
    7 |                 if(a+b+c+d==7) cout<<a<<"+"<<b<<"+"<<c<<"+"<<d<<"="<<7<<endl;
      |                                ^~~~
main.c:7:73: error: 'endl' undeclared (first use in this function)
    7 |                 if(a+b+c+d==7) cout<<a<<"+"<<b<<"+"<<c<<"+"<<d<<"="<<7<<endl;
      |                                                                         ^~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void Standard_Input(int* a,int* b,int* c,int* d)
{
    int x,r;
    r=scanf("%d",&x);
    while(x>=10000||x<0)
    {
        r=scanf("%d",&x);
    }
    *d=x%10;x/=10;
    *c=x%10;x/=10;
    *b=x%10;x/=10;
    *a=x%10;
}

int main()
{
    char op1='0',op2='0',op3='0';
    int a,b,c,d;
    while(Standard_Input(&a,&b,&c,&d)==1)
    {
        if(a+b+c+d==7)
        {
            op1=op2=op3='+';
            printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
        }
        else if(a+b+c-d==7)
        {
            op1=op2='+';
            op3='-';
            printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
        }
        else if(a+b-c+d==7)
        {
            op1=op3='+';op2='-';
            printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
        }
        else if(a+b-c-d==7)
        {
            op1='+';op2=op3='-';
            printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
        }
        else if(a-b+c+d==7)
        {
            op1='-';op2=op3='+';
            printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
        }
        else if(a-b+c-d==7)
        {
            op1=op3='+';op2='-';
            printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
        }
        else if(a-b-c+d==7)
        {
            op1=op2='-';op3='+';
            printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
        }
        else if(a-b-c-d==7)
        {
            op1=op2=op3='-';
            printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
        }
        else
        {
            printf("no answer!please input another one:");
            continue;
        }
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:23:11: error: void value not ignored as it ought to be
   23 |     while(Standard_Input(&a,&b,&c,&d)==1)
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
    char op1='0',op2='0',op3='0';
    int a,b,c,d;
    while(1)
    {
        Standard_Input();
        if(a+b+c+d==7)
        {
            op1=op2=op3='+';
            printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
        }
        else if(a+b+c-d==7)
        {
            op1=op2='+';
            op3='-';
            pprintf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
        }
        else if(a+b-c+d==7)
        {
            op1=op3='+';op2='-';
            printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
        }
        else if(a+b-c-d==7)
        {
            op1='+';op2=op3='-';
            printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
        }
        else if(a-b+c+d==7)
        {
            op1='-';op2=op3='+';
            printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
        }
        else if(a-b+c-d==7)
        {
            op1=op3='+';op2='-';
            printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
        }
        else if(a-b-c+d==7)
        {
            op1=op2='-';op3='+';
            printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
        }
        else if(a-b-c-d==7)
        {
            op1=op2=op3='-';
            printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
        }
        else
        {
            printf("no answer!please input another one:");
            continue;
        }
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:11:9: error: implicit declaration of function 'Standard_Input' [-Wimplicit-function-declaration]
   11 |         Standard_Input();
      |         ^~~~~~~~~~~~~~
main.c:21:13: error: implicit declaration of function 'pprintf'; did you mean 'dprintf'? [-Wimplicit-function-declaration]
   21 |             pprintf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
      |             ^~~~~~~
      |             dprintf
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
    char op1='0',op2='0',op3='0';
    int a,b,c,d;
    while(1)
    {
        Standard Input();
        if(a+b+c+d==7)
        {
            op1=op2=op3='+';
            printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
        }
        else if(a+b+c-d==7)
        {
            op1=op2='+';
            op3='-';
            pprintf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
        }
        else if(a+b-c+d==7)
        {
            op1=op3='+';op2='-';
            printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
        }
        else if(a+b-c-d==7)
        {
            op1='+';op2=op3='-';
            printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
        }
        else if(a-b+c+d==7)
        {
            op1='-';op2=op3='+';
            printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
        }
        else if(a-b+c-d==7)
        {
            op1=op3='+';op2='-';
            printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
        }
        else if(a-b-c+d==7)
        {
            op1=op2='-';op3='+';
            printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
        }
        else if(a-b-c-d==7)
        {
            op1=op2=op3='-';
            printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
        }
        else
        {
            printf("no answer!please input another one:");
            continue;
        }
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:11:9: error: unknown type name 'Standard'
   11 |         Standard Input();
      |         ^~~~~~~~
main.c:21:13: error: implicit declaration of function 'pprintf'; did you mean 'dprintf'? [-Wimplicit-function-declaration]
   21 |             pprintf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
      |             ^~~~~~~
      |             dprintf
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
    char op1='0',op2='0',op3='0';
    int a,b,c,d;
    while(Standard_Input()==1)
    {
            if(a+b+c+d==7)
            {
                op1=op2=op3='+';
                printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
            }
            else if(a+b+c-d==7)
            {
                op1=op2='+';
                op3='-';
                pprintf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
            }
            else if(a+b-c+d==7)
            {
                op1=op3='+';op2='-';
                printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
            }
            else if(a+b-c-d==7)
            {
                op1='+';op2=op3='-';
                printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
            }
            else if(a-b+c+d==7)
            {
                op1='-';op2=op3='+';
                printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
            }
            else if(a-b+c-d==7)
            {
                op1=op3='+';op2='-';
                printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
            }
            else if(a-b-c+d==7)
            {
                op1=op2='-';op3='+';
                printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
            }
            else if(a-b-c-d==7)
            {
                op1=op2=op3='-';
                printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
            }
            else
            {
                printf("no answer!please input another one:");
                continue;
            }
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:11: error: implicit declaration of function 'Standard_Input' [-Wimplicit-function-declaration]
    9 |     while(Standard_Input()==1)
      |           ^~~~~~~~~~~~~~
main.c:20:17: error: implicit declaration of function 'pprintf'; did you mean 'dprintf'? [-Wimplicit-function-declaration]
   20 |                 pprintf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
      |                 ^~~~~~~
      |                 dprintf
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
    char op1='0',op2='0',op3='0';
    while(Standard_Input()==1)
    {
        if(flag==1)
        {
            if(a+b+c+d==7)
            {
                op1=op2=op3='+';
                printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
            }
            else if(a+b+c-d==7)
            {
                op1=op2='+';
                op3='-';
                pprintf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
            }
            else if(a+b-c+d==7)
            {
                op1=op3='+';op2='-';
                printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
            }
            else if(a+b-c-d==7)
            {
                op1='+';op2=op3='-';
                printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
            }
            else if(a-b+c+d==7)
            {
                op1='-';op2=op3='+';
                printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
            }
            else if(a-b+c-d==7)
            {
                op1=op3='+';op2='-';
                printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
            }
            else if(a-b-c+d==7)
            {
                op1=op2='-';op3='+';
                printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
            }
            else if(a-b-c-d==7)
            {
                op1=op2=op3='-';
                printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
            }
            else
            {
                printf("no answer!please input another one:");
                continue;
            }
        }
        else continue;
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:11: error: implicit declaration of function 'Standard_Input' [-Wimplicit-function-declaration]
    8 |     while(Standard_Input()==1)
      |           ^~~~~~~~~~~~~~
main.c:10:12: error: 'flag' undeclared (first use in this function)
   10 |         if(flag==1)
      |            ^~~~
main.c:10:12: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:16: error: 'a' undeclared (first use in this function)
   12 |             if(a+b+c+d==7)
      |                ^
main.c:12:18: error: 'b' undeclared (first use in this function)
   12 |             if(a+b+c+d==7)
      |                  ^
main.c:12:20: error: 'c' undeclared (first use in this function)
   12 |             if(a+b+c+d==7)
      |                    ^
main.c:12:22: error: 'd' undeclared (first use in this function)
   12 |             if(a+b+c+d==7)
      |                      ^
main.c:21:17: error: implicit declaration of function 'pprintf'; did you mean 'dprintf'? [-Wimplicit-function-declaration]
   21 |                 pprintf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
      |                 ^~~~~~~
      |                 dprintf
Language: C

#include <stdio.h>
#include <stdlib.h>

int main()
{
    char op1='0',op2='0',op3='0';
    int a,b,c,d;
    while(Standard_Input()==1)
    {
        int i,flag=1;
        Standard_Input(a,x);
        for(i=0;i<4;++i)
        {
            if(a+b+c+d==7)
            {
                op1=op2=op3='+';
                printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
            }
            else if(a+b+c-d==7)
            {
                op1=op2='+';
                op3='-';
                printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
            }
            else if(a+b-c+d==7)
            {
                op1=op3='+';op2='-';
                printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
            }
            else if(a+b-c-d==7)
            {
                op1='+';op2=op3='-';
                printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
            }
            else if(a-b+c+d==7)
            {
                op1='-';op2=op3='+';
                printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
            }
            else if(a-b+c-d==7)
            {
                op1=op3='+';op2='-';
               printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
            }
            else if(a-b-c+d==7)
            {
                op1=op2='-';op3='+';
                printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
            }
            else if(a-b-c-d==7)
            {
                op1=op2=op3='-';
                printf("%d%c%d%c%d%c%d=7\n",a,op1,b,op2,c,op3,d);
            }
            else
            {
                printf("no answer!please input another one:");
                continue;
            }
        }
        else continue;
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:11: error: implicit declaration of function 'Standard_Input' [-Wimplicit-function-declaration]
    8 |     while(Standard_Input()==1)
      |           ^~~~~~~~~~~~~~
main.c:11:26: error: 'x' undeclared (first use in this function)
   11 |         Standard_Input(a,x);
      |                          ^
main.c:11:26: note: each undeclared identifier is reported only once for each function it appears in
main.c:61:9: error: 'else' without a previous 'if'
   61 |         else continue;
      |         ^~~~
Language: C

#include <stdio.h>
#include <stdlib.h>


int main()
{
    char op1='0',op2='0',op3='0';
    while(Standard_Input()==1)
    {
        int i,flag=1;
        Standard_Input(a,x);
        for(i=0;i<4;++i)
        {
            if(a[i]>=10||a[i]<0)
            {
                flag=0;
                break;
            }
            else continue;
        }
        if(flag==1)
        {
            if(a[0]+a[1]+a[2]+a[3]==7)
            {
                op1=op2=op3='+';
                printf("%d%c%d%c%d%c%d=7\n",a[0],op1,a[1],op2,a[2],op3,a[3]);
            }
            else if(a[0]+a[1]+a[2]-a[3]==7)
            {
                op1=op2='+';
                op3='-';
                printf("%d%c%d%c%d%c%d=7\n",a[0],op1,a[1],op2,a[2],op3,a[3]);
            }
            else if(a[0]+a[1]-a[2]+a[3]==7)
            {
                op1=op3='+';op2='-';
                printf("%d%c%d%c%d%c%d=7\n",a[0],op1,a[1],op2,a[2],op3,a[3]);
            }
            else if(a[0]+a[1]-a[2]-a[3]==7)
            {
                op1='+';op2=op3='-';
                printf("%d%c%d%c%d%c%d=7\n",a[0],op1,a[1],op2,a[2],op3,a[3]);
            }
            else if(a[0]-a[1]+a[2]+a[3]==7)
            {
                op1='-';op2=op3='+';
                printf("%d%c%d%c%d%c%d=7\n",a[0],op1,a[1],op2,a[2],op3,a[3]);
            }
            else if(a[0]-a[1]+a[2]-a[3]==7)
            {
                op1=op3='+';op2='-';
                printf("%d%c%d%c%d%c%d=7\n",a[0],op1,a[1],op2,a[2],op3,a[3]);
            }
            else if(a[0]-a[1]-a[2]+a[3]==7)
            {
                op1=op2='-';op3='+';
                printf("%d%c%d%c%d%c%d=7\n",a[0],op1,a[1],op2,a[2],op3,a[3]);
            }
            else if(a[0]-a[1]-a[2]-a[3]==7)
            {
                op1=op2=op3='-';
                printf("%d%c%d%c%d%c%d=7\n",a[0],op1,a[1],op2,a[2],op3,a[3]);
            }
            else
            {
                printf("no answer!please input another one:");
                continue;
            }
        }
        else continue;
    }
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:8:11: error: implicit declaration of function 'Standard_Input' [-Wimplicit-function-declaration]
    8 |     while(Standard_Input()==1)
      |           ^~~~~~~~~~~~~~
main.c:11:24: error: 'a' undeclared (first use in this function)
   11 |         Standard_Input(a,x);
      |                        ^
main.c:11:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:26: error: 'x' undeclared (first use in this function)
   11 |         Standard_Input(a,x);
      |                          ^
Language: C

#include<iostream>
using namespace std;
class fun
{
private:
    int a,b,c,d;
public:
    fun(int x,int y,int z,int m)
    {
        a=x;
        b=y;
        c=z;
        d=m;
    }
    int raid()
    {
        if(a+b+c+d==7)
            cout<<a<<"+"<<b<<"+"<<c<<"+"<<d<<"="<<7<<endl;
        if(a+b+c-d==7)
            cout<<a<<"+"<<b<<"+"<<c<<"-"<<d<<"="<<7<<endl;
        if(a+b-c-d==7)
            cout<<a<<"+"<<b<<"-"<<c<<"-"<<d<<"="<<7<<endl;
        if(a+b-c+d==7)
            cout<<a<<"+"<<b<<"-"<<c<<"+"<<d<<"="<<7<<endl;
        if(a-b-c-d==7)
            cout<<a<<"-"<<b<<"-"<<c<<"-"<<d<<"="<<7<<endl;
        if(a-b-c+d==7)
            cout<<a<<"-"<<b<<"-"<<c<<"+"<<d<<"="<<7<<endl;
        if(a-b+c+d==7)
            cout<<a<<"-"<<b<<"+"<<c<<"+"<<d<<"="<<7<<endl;
        if(a-b+c-d==7)
            cout<<a<<"-"<<b<<"+"<<c<<"-"<<d<<"="<<7<<endl;
    }
};
int main()
{
    int a,b,c,d;
    cin>>a;
    d=a%10;
    a/=10;
    c=a%10;
    a/=10;
    b=a%10;
    a/=10;
    fun h(a,b,c,d);
    h.raid();
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<iostream>
using namespace std;

int main()
{
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if(a+b+c+d==7)cout<<a<<"+"<<b<<"+"<<c<<"+"<<d<<"=7";
    if(a+b+c-d==7)cout<<a<<"+"<<b<<"+"<<c<<"-"<<d<<"=7";
    if(a+b-c+d==7)cout<<a<<"+"<<b<<"-"<<c<<"+"<<d<<"=7";
    if(a+b-c-d==7)cout<<a<<"+"<<b<<"-"<<c<<"-"<<d<<"=7";
    if(a-b+c+d==7)cout<<a<<"-"<<b<<"+"<<c<<"+"<<d<<"=7";
    if(a-b+c-d==7)cout<<a<<"-"<<b<<"+"<<c<<"-"<<d<<"=7";
    if(a-b-c+d==7)cout<<a<<"-"<<b<<"-"<<c<<"+"<<d<<"=7";
    if(a-b-c-d==7)cout<<a<<"-"<<b<<"-"<<c<<"-"<<d<<"=7";
    return 0;
}


Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

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

int main()
{
    int a,b,c,d;
    int k;
    cin>>k;
    d=k%10;
    k/=10;
    c=k%10;
    k/=10;
    b=k%10;
    k/=10;
    a=k;

    while(1)
    {
        if(a+b+c+d==7) {cout<<a<<"+"<<b<<"+"<<c<<"+"<<d<<"=7"<<endl;return 1;}
        if(a+b+c-d==7) {cout<<a<<"+"<<b<<"+"<<c<<"-"<<d<<"=7"<<endl;return 1;}
        if(a+b-c+d==7) {cout<<a<<"+"<<b<<"-"<<c<<"+"<<d<<"=7"<<endl;return 1;}
        if(a-b+c+d==7) {cout<<a<<"-"<<b<<"+"<<c<<"+"<<d<<"=7"<<endl;return 1;}
        if(a-b-c+d==7) {cout<<a<<"-"<<b<<"-"<<c<<"+"<<d<<"=7"<<endl;return 1;}
        if(a-b+c-d==7) {cout<<a<<"-"<<b<<"+"<<c<<"-"<<d<<"=7"<<endl;return 1;}
        if(a+b-c-d==7) {cout<<a<<"+"<<b<<"-"<<c<<"-"<<d<<"=7"<<endl;return 1;}
        if(a-b-c-d==7) {cout<<a<<"-"<<b<<"-"<<c<<"-"<<d<<"=7"<<endl;return 1;}
        break;

    }
}


Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<conio.h>
#include<cstdlib>
using namespace std;
int main() 
{
	int a,b,c,d,pd=0;
	cin>>a;
	d=a%10;
	a=a/10;
	c=a%10;
	a=a/10;
	b=a%10;
	a=a/10;
    if(a+b+c+d==7){pd++;cout<<a<<"+"<<b<<"+"<<c<<"+"<<d<<"=7";return 0;}
    if(a+b+c-d==7){pd++;cout<<a<<"+"<<b<<"+"<<c<<"-"<<d<<"=7";return 0;}
    if(a+b-c+d==7){pd++;cout<<a<<"+"<<b<<"-"<<c<<"+"<<d<<"=7";return 0;}
   	if(a+b-c-d==7){pd++;cout<<a<<"+"<<b<<"-"<<c<<"-"<<d<<"=7";return 0;}
  	if(a-b+c+d==7){pd++;cout<<a<<"-"<<b<<"+"<<c<<"+"<<d<<"=7";return 0;}
  	if(a-b+c-d==7){pd++;cout<<a<<"-"<<b<<"+"<<c<<"-"<<d<<"=7";return 0;}
   	if(a-b-c+d==7){pd++;cout<<a<<"-"<<b<<"-"<<c<<"+"<<d<<"=7";return 0;}
  	if(a-b-c-d==7){pd++;cout<<a<<"-"<<b<<"-"<<c<<"-"<<d<<"=7";return 0;}
}

Compiler output:
a.cc:2:9: fatal error: conio.h: No such file or directory
    2 | #include<conio.h>
      |         ^~~~~~~~~
compilation terminated.
Language: C

#include<iostream>
#include<conio.h>
#include<cstdlib>
using namespace std;
int main() 
{
	int a,b,c,d,pd=0;
	cin>>a;
	d=a%10;
	a=a/10;
	c=a%10;
	a=a/10;
	b=a%10;
	a=a/10;
    if(a+b+c+d==7){pd++;cout<<a<<"+"<<b<<"+"<<c<<"+"<<d<<"=7";return 0;}
    if(a+b+c-d==7){pd++;cout<<a<<"+"<<b<<"+"<<c<<"-"<<d<<"=7";return 0;}
    if(a+b-c+d==7){pd++;cout<<a<<"+"<<b<<"-"<<c<<"+"<<d<<"=7";return 0;}
   	if(a+b-c-d==7){pd++;cout<<a<<"+"<<b<<"-"<<c<<"-"<<d<<"=7";return 0;}
  	if(a-b+c+d==7){pd++;cout<<a<<"-"<<b<<"+"<<c<<"+"<<d<<"=7";return 0;}
  	if(a-b+c-d==7){pd++;cout<<a<<"-"<<b<<"+"<<c<<"-"<<d<<"=7";return 0;}
   	if(a-b-c+d==7){pd++;cout<<a<<"-"<<b<<"-"<<c<<"+"<<d<<"=7";return 0;}
  	if(a-b-c-d==7){pd++;cout<<a<<"-"<<b<<"-"<<c<<"-"<<d<<"=7";return 0;}
}


Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<conio.h>
#include<cstdlib>
using namespace std;
int main() 
{
	int a,b,c,d,pd=0;
	cin>>a;
	d=a%10;
	a=a/10;
	c=a%10;
	a=a/10;
	b=a%10;
	a=a/10;
	cout<<endl;
    if(a+b+c+d==7){pd++;cout<<a<<"+"<<b<<"+"<<c<<"+"<<d<<"=7";return 0;}
    if(a+b+c-d==7){pd++;cout<<a<<"+"<<b<<"+"<<c<<"-"<<d<<"=7";return 0;}
    if(a+b-c+d==7){pd++;cout<<a<<"+"<<b<<"-"<<c<<"+"<<d<<"=7";return 0;}
   	if(a+b-c-d==7){pd++;cout<<a<<"+"<<b<<"-"<<c<<"-"<<d<<"=7";return 0;}
  	if(a-b+c+d==7){pd++;cout<<a<<"-"<<b<<"+"<<c<<"+"<<d<<"=7";return 0;}
  	if(a-b+c-d==7){pd++;cout<<a<<"-"<<b<<"+"<<c<<"-"<<d<<"=7";return 0;}
   	if(a-b-c+d==7){pd++;cout<<a<<"-"<<b<<"-"<<c<<"+"<<d<<"=7";return 0;}
  	if(a-b-c-d==7){pd++;cout<<a<<"-"<<b<<"-"<<c<<"-"<<d<<"=7";return 0;}
}


Compiler output:
a.cc:2:9: fatal error: conio.h: No such file or directory
    2 | #include<conio.h>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<conio.h>
#include<cstdlib>
using namespace std;
int main() 
{
	int a,b,c,d,pd=0;
	cin>>a;
	d=a%10;
	a=a/10;
	c=a%10;
	a=a/10;
	b=a%10;
	a=a/10;
    if(a+b+c+d==7){pd++;cout<<a<<"+"<<b<<"+"<<c<<"+"<<d<<"=7";return 0;}
    if(a+b+c-d==7){pd++;cout<<a<<"+"<<b<<"+"<<c<<"-"<<d<<"=7";return 0;}
    if(a+b-c+d==7){pd++;cout<<a<<"+"<<b<<"-"<<c<<"+"<<d<<"=7";return 0;}
   	if(a+b-c-d==7){pd++;cout<<a<<"+"<<b<<"-"<<c<<"-"<<d<<"=7";return 0;}
  	if(a-b+c+d==7){pd++;cout<<a<<"-"<<b<<"+"<<c<<"+"<<d<<"=7";return 0;}
  	if(a-b+c-d==7){pd++;cout<<a<<"-"<<b<<"+"<<c<<"-"<<d<<"=7";return 0;}
   	if(a-b-c+d==7){pd++;cout<<a<<"-"<<b<<"-"<<c<<"+"<<d<<"=7";return 0;}
  	if(a-b-c-d==7){pd++;cout<<a<<"-"<<b<<"-"<<c<<"-"<<d<<"=7";return 0;}
}


Compiler output:
a.cc:2:9: fatal error: conio.h: No such file or directory
    2 | #include<conio.h>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<conio.h>
#include<cstdlib>
using namespace std;
int main() 
{
	int a,b,c,d,pd=0;
	cin>>a;
	d=a%10;
	a=a/10;
	c=a%10;
	a=a/10;
	b=a%10;
	a=a/10;
    if(a+b+c+d==7){pd++;cout<<a<<"+"<<b<<"+"<<c<<"+"<<d<<"=7";exit(0);}
    if(a+b+c-d==7){pd++;cout<<a<<"+"<<b<<"+"<<c<<"-"<<d<<"=7";exit(0);}
    if(a+b-c+d==7){pd++;cout<<a<<"+"<<b<<"-"<<c<<"+"<<d<<"=7";exit(0);}
   	if(a+b-c-d==7){pd++;cout<<a<<"+"<<b<<"-"<<c<<"-"<<d<<"=7";exit(0);}
  	if(a-b+c+d==7){pd++;cout<<a<<"-"<<b<<"+"<<c<<"+"<<d<<"=7";exit(0);}
  	if(a-b+c-d==7){pd++;cout<<a<<"-"<<b<<"+"<<c<<"-"<<d<<"=7";exit(0);}
   	if(a-b-c+d==7){pd++;cout<<a<<"-"<<b<<"-"<<c<<"+"<<d<<"=7";exit(0);}
  	if(a-b-c-d==7){pd++;cout<<a<<"-"<<b<<"-"<<c<<"-"<<d<<"=7";exit(0);}
}


Compiler output:
a.cc:2:9: fatal error: conio.h: No such file or directory
    2 | #include<conio.h>
      |         ^~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
int main(){
	int a,b,c,d,e;
	scanf("%d",&e);
	a=e/1000;
	b=(e/100)%10;
	c=(e/10)%10;
	d=e%10;
	if((a+b+c+d)==7)printf("%d+%d+%d+%d=7\n",a,b,c,d);
	if((a+b+c-d)==7)printf("%d+%d+%d-%d=7\n",a,b,c,d);
	if((a+b-c+d)==7)printf("%d+%d-%d+%d=7\n",a,b,c,d); 
	if((a+b-c-d)==7)printf("%d+%d-%d-%d=7\n",a,b,c,d);
	if((a-b+c+)d==7)printf("%d-%d+%d+%d=7\n",a,b,c,d);
	if((a-b+c-d)==7)printf("%d-%d+%d-%d=7\n",a,b,c,d);
	if((a-b-c-d)==7)printf("%d-%d-%d-%d=7\n",a,b,c,d);
	if((a-b-c+d)==7)printf("%d-%d-%d+%d=7\n",a,b,c,d);
	return 0; 
}

Compiler output:
main.c: In function 'main':
main.c:13:19: error: expected expression before ')' token
   13 |         if((a-b+c+)d==7)printf("%d-%d+%d+%d=7\n",a,b,c,d);
      |                   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	int a[4];
	char t;
	int number;
	for(int i=0;i<4;i++)
	{
		cin >> t;
		a[i] = t - 48;
	}
	for(int i=0;i<16;i++)
	{
		int sum = 0;
		for(int j=0;j<4;j++)
		{
			sum += a[j] * dir[i][j];
		}
		if (sum == 7)
		{
			number = i;
		}
	}
	cout <<( (dir[number][0] == 1) ? "" : "-");
	for (int i = 0; i < 3; i++)
		cout<<a[i]<< ((dir[number][i+1] == 1) ? "+" : "-");
	cout << a[3] << "=7";
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:39: error: 'dir' was not declared in this scope; did you mean 'div'?
   21 |                         sum += a[j] * dir[i][j];
      |                                       ^~~
      |                                       div
a.cc:28:19: error: 'dir' was not declared in this scope; did you mean 'div'?
   28 |         cout <<( (dir[number][0] == 1) ? "" : "-");
      |                   ^~~
      |                   div
Language: C++

#include <iostream>
#include <vector>
#include <iterator>
#include <algorithm>

using namespace std;

vector<bool> c;
vector<int> b;
bool done;

void dp(int depth);

int main(){
    done = false;
    vector<char> a;
    a.resize(4);
    b.resize(4);
    c.resize(3);
    copy_n(istream_iterator<char>(cin), 4, a.begin());
    transform(a.begin(), a.end(), b.begin(), [](char i){ return (int)(i - '0'); });
    dp(0);
    return 0;
}

void dp(int depth){
    if(done) return;
    if(depth >= 3){
        vector<int>::iterator bi = b.begin();
        int sum = accumulate(c.begin(), c.end(), b[0], [&bi](int i, bool j){bi++; return (j ? i + *bi : i - *bi); });
        if(sum != 7) return;
        cout << b[0];
        bi = b.begin();
        for_each(c.begin(), c.end(), [&bi](bool j){bi++; cout << (j ? "+" : "-") << *bi; });
        cout << "=7" << endl;
        done = true;
    }else{
        c[depth] = true;
        dp(depth + 1);
        c[depth] = false;
        dp(depth + 1);
    }
}


Compiler output:
a.cc: In function 'void dp(int)':
a.cc:30:19: error: 'accumulate' was not declared in this scope
   30 |         int sum = accumulate(c.begin(), c.end(), b[0], [&bi](int i, bool j){bi++; return (j ? i + *bi : i - *bi); });
      |                   ^~~~~~~~~~
Language: C++

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

int main() {
  char s[5];
  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:8:14: error: extended character ’ is not valid in an identifier
    8 |   int A=s[0]-’0’, B=s[1]-’0’, C=s[2]-’0’, D=s[3]-’0’;
      |              ^
a.cc:8:14: error: extended character ’ is not valid in an identifier
a.cc:8:26: error: extended character ’ is not valid in an identifier
    8 |   int A=s[0]-’0’, B=s[1]-’0’, C=s[2]-’0’, D=s[3]-’0’;
      |                          ^
a.cc:8:26: error: extended character ’ is not valid in an identifier
a.cc:8:38: error: extended character ’ is not valid in an identifier
    8 |   int A=s[0]-’0’, B=s[1]-’0’, C=s[2]-’0’, D=s[3]-’0’;
      |                                      ^
a.cc:8:38: error: extended character ’ is not valid in an identifier
a.cc:8:50: error: extended character ’ is not valid in an identifier
    8 |   int A=s[0]-’0’, B=s[1]-’0’, C=s[2]-’0’, D=s[3]-’0’;
      |                                                  ^
a.cc:8:50: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:8:14: error: '\U000020190\U00002019' was not declared in this scope
    8 |   int A=s[0]-’0’, B=s[1]-’0’, C=s[2]-’0’, D=s[3]-’0’;
      |              ^~~
a.cc:9:9: error: 'B' was not declared in this scope
    9 |   if (A-B-C-D==7) {
      |         ^
a.cc:9:11: error: 'C' was not declared in this scope
    9 |   if (A-B-C-D==7) {
      |           ^
a.cc:9:13: error: 'D' was not declared in this scope
    9 |   if (A-B-C-D==7) {
      |             ^
Language: C++

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

int main() {
  char s[5];
  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:8:14: error: extended character ’ is not valid in an identifier
    8 |   int A=s[0]-’0’, B=s[1]-’0’, C=s[2]-’0’, D=s[3]-’0’;
      |              ^
a.cc:8:14: error: extended character ’ is not valid in an identifier
a.cc:8:26: error: extended character ’ is not valid in an identifier
    8 |   int A=s[0]-’0’, B=s[1]-’0’, C=s[2]-’0’, D=s[3]-’0’;
      |                          ^
a.cc:8:26: error: extended character ’ is not valid in an identifier
a.cc:8:38: error: extended character ’ is not valid in an identifier
    8 |   int A=s[0]-’0’, B=s[1]-’0’, C=s[2]-’0’, D=s[3]-’0’;
      |                                      ^
a.cc:8:38: error: extended character ’ is not valid in an identifier
a.cc:8:50: error: extended character ’ is not valid in an identifier
    8 |   int A=s[0]-’0’, B=s[1]-’0’, C=s[2]-’0’, D=s[3]-’0’;
      |                                                  ^
a.cc:8:50: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:8:14: error: '\U000020190\U00002019' was not declared in this scope
    8 |   int A=s[0]-’0’, B=s[1]-’0’, C=s[2]-’0’, D=s[3]-’0’;
      |              ^~~
a.cc:9:9: error: 'B' was not declared in this scope
    9 |   if (A-B-C-D==7) {
      |         ^
a.cc:9:11: error: 'C' was not declared in this scope
    9 |   if (A-B-C-D==7) {
      |           ^
a.cc:9:13: error: 'D' was not declared in this scope
    9 |   if (A-B-C-D==7) {
      |             ^
a.cc:18:30: error: 'a' was not declared in this scope
   18 |     printf("%d+%d-%d-%d=7\n",a,b,c,d);
      |                              ^
a.cc:18:32: error: 'b' was not declared in this scope
   18 |     printf("%d+%d-%d-%d=7\n",a,b,c,d);
      |                                ^
a.cc:18:34: error: 'c' was not declared in this scope
   18 |     printf("%d+%d-%d-%d=7\n",a,b,c,d);
      |                                  ^
a.cc:18:36: error: 'd' was not declared in this scope
   18 |     printf("%d+%d-%d-%d=7\n",a,b,c,d);
      |                                    ^
Language: C++

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

int main() {
  int s[5];
  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:8:14: error: extended character ’ is not valid in an identifier
    8 |   int A=s[0]-’0’, B=s[1]-’0’, C=s[2]-’0’, D=s[3]-’0’;
      |              ^
a.cc:8:14: error: extended character ’ is not valid in an identifier
a.cc:8:26: error: extended character ’ is not valid in an identifier
    8 |   int A=s[0]-’0’, B=s[1]-’0’, C=s[2]-’0’, D=s[3]-’0’;
      |                          ^
a.cc:8:26: error: extended character ’ is not valid in an identifier
a.cc:8:38: error: extended character ’ is not valid in an identifier
    8 |   int A=s[0]-’0’, B=s[1]-’0’, C=s[2]-’0’, D=s[3]-’0’;
      |                                      ^
a.cc:8:38: error: extended character ’ is not valid in an identifier
a.cc:8:50: error: extended character ’ is not valid in an identifier
    8 |   int A=s[0]-’0’, B=s[1]-’0’, C=s[2]-’0’, D=s[3]-’0’;
      |                                                  ^
a.cc:8:50: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:8:14: error: '\U000020190\U00002019' was not declared in this scope
    8 |   int A=s[0]-’0’, B=s[1]-’0’, C=s[2]-’0’, D=s[3]-’0’;
      |              ^~~
a.cc:9:9: error: 'B' was not declared in this scope
    9 |   if (A-B-C-D==7) {
      |         ^
a.cc:9:11: error: 'C' was not declared in this scope
    9 |   if (A-B-C-D==7) {
      |           ^
a.cc:9:13: error: 'D' was not declared in this scope
    9 |   if (A-B-C-D==7) {
      |             ^
a.cc:18:30: error: 'a' was not declared in this scope
   18 |     printf("%d+%d-%d-%d=7\n",a,b,c,d);
      |                              ^
a.cc:18:32: error: 'b' was not declared in this scope
   18 |     printf("%d+%d-%d-%d=7\n",a,b,c,d);
      |                                ^
a.cc:18:34: error: 'c' was not declared in this scope
   18 |     printf("%d+%d-%d-%d=7\n",a,b,c,d);
      |                                  ^
a.cc:18:36: error: 'd' was not declared in this scope
   18 |     printf("%d+%d-%d-%d=7\n",a,b,c,d);
      |                                    ^
Language: C++

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

int main() {
  int s[5];
  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:8:14: error: extended character ’ is not valid in an identifier
    8 |   int A=s[0]-’0’; B=s[1]-’0’, C=s[2]-’0’, D=s[3]-’0’;
      |              ^
a.cc:8:14: error: extended character ’ is not valid in an identifier
a.cc:8:26: error: extended character ’ is not valid in an identifier
    8 |   int A=s[0]-’0’; B=s[1]-’0’, C=s[2]-’0’, D=s[3]-’0’;
      |                          ^
a.cc:8:26: error: extended character ’ is not valid in an identifier
a.cc:8:38: error: extended character ’ is not valid in an identifier
    8 |   int A=s[0]-’0’; B=s[1]-’0’, C=s[2]-’0’, D=s[3]-’0’;
      |                                      ^
a.cc:8:38: error: extended character ’ is not valid in an identifier
a.cc:8:50: error: extended character ’ is not valid in an identifier
    8 |   int A=s[0]-’0’; B=s[1]-’0’, C=s[2]-’0’, D=s[3]-’0’;
      |                                                  ^
a.cc:8:50: error: extended character ’ is not valid in an identifier
a.cc: In function 'int main()':
a.cc:8:14: error: '\U000020190\U00002019' was not declared in this scope
    8 |   int A=s[0]-’0’; B=s[1]-’0’, C=s[2]-’0’, D=s[3]-’0’;
      |              ^~~
a.cc:8:19: error: 'B' was not declared in this scope
    8 |   int A=s[0]-’0’; B=s[1]-’0’, C=s[2]-’0’, D=s[3]-’0’;
      |                   ^
a.cc:8:31: error: 'C' was not declared in this scope
    8 |   int A=s[0]-’0’; B=s[1]-’0’, C=s[2]-’0’, D=s[3]-’0’;
      |                               ^
a.cc:8:43: error: 'D' was not declared in this scope
    8 |   int A=s[0]-’0’; B=s[1]-’0’, C=s[2]-’0’, D=s[3]-’0’;
      |                                           ^
a.cc:18:30: error: 'a' was not declared in this scope
   18 |     printf("%d+%d-%d-%d=7\n",a,b,c,d);
      |                              ^
a.cc:18:32: error: 'b' was not declared in this scope
   18 |     printf("%d+%d-%d-%d=7\n",a,b,c,d);
      |                                ^
a.cc:18:34: error: 'c' was not declared in this scope
   18 |     printf("%d+%d-%d-%d=7\n",a,b,c,d);
      |                                  ^
a.cc:18:36: error: 'd' was not declared in this scope
   18 |     printf("%d+%d-%d-%d=7\n",a,b,c,d);
      |                                    ^