Language: C++

using System;
using System.Linq;//リストの使用
using System.Collections.Generic;
using System.Text;//テキストの高速出力に必要
class Program
{
	static void Main()
	{
		string s = Console.ReadLine();
    int a = s[0] - '0';
    int b = s[1] - '0';
    int c = s[2] - '0';
    int d = s[3] - '0';
    string answer;

    while(true)
    {
      if(a+b+c+d == 7)
      {
        answer=a.ToString()+"+"+b.ToString()+"+"+c.ToString()+"+"+d.ToString()+"=7"
      }
      if(a+b+c-d == 7)
      {
        answer=a.ToString()+"+"+b.ToString()+"+"+c.ToString()+"-"+d.ToString()+"=7"
      }
      if(a+b-c+d == 7)
      {
        answer=a.ToString()+"+"+b.ToString()+"-"+c.ToString()+"+"+d.ToString()+"=7"
      }
      if(a+b-c-d == 7)
      {
        answer=a.ToString()+"+"+b.ToString()+"-"+c.ToString()+"-"+d.ToString()+"=7"
      }
      if(a-b+c+d == 7)
      {
        answer=a.ToString()+"-"+b.ToString()+"+"+c.ToString()+"+"+d.ToString()+"=7"
      }
      if(a-b+c-d == 7)
      {
        answer=a.ToString()+"-"+b.ToString()+"+"+c.ToString()+"-"+d.ToString()+"=7"
      }
      if(a-b-c+d == 7)
      {
        answer=a.ToString()+"-"+b.ToString()+"-"+c.ToString()+"+"+d.ToString()+"=7"
      }
      if(a-b-c-d == 7)
      {
        answer=a.ToString()+"-"+b.ToString()+"-"+c.ToString()+"-"+d.ToString()+"=7"
      }
    }
		Console.WriteLine(answer);//WriteLineをWriteとすると、改行なしで出力。
	}
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Linq;//リストの使用
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Text;//テキストの高速出力に必要
      |       ^~~~~~
a.cc:53:2: error: expected ';' after class definition
   53 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Program::Main()':
a.cc:9:17: error: 'string' was not declared in this scope
    9 |                 string s = Console.ReadLine();
      |                 ^~~~~~
a.cc:10:13: error: 's' was not declared in this scope
   10 |     int a = s[0] - '0';
      |             ^
a.cc:14:12: error: expected ';' before 'answer'
   14 |     string answer;
      |            ^~~~~~
a.cc:20:9: error: 'answer' was not declared in this scope
   20 |         answer=a.ToString()+"+"+b.ToString()+"+"+c.ToString()+"+"+d.ToString()+"=7"
      |         ^~~~~~
a.cc:20:18: error: request for member 'ToString' in 'a', which is of non-class type 'int'
   20 |         answer=a.ToString()+"+"+b.ToString()+"+"+c.ToString()+"+"+d.ToString()+"=7"
      |                  ^~~~~~~~
a.cc:20:35: error: request for member 'ToString' in 'b', which is of non-class type 'int'
   20 |         answer=a.ToString()+"+"+b.ToString()+"+"+c.ToString()+"+"+d.ToString()+"=7"
      |                                   ^~~~~~~~
a.cc:20:52: error: request for member 'ToString' in 'c', which is of non-class type 'int'
   20 |         answer=a.ToString()+"+"+b.ToString()+"+"+c.ToString()+"+"+d.ToString()+"=7"
      |                                                    ^~~~~~~~
a.cc:20:69: error: request for member 'ToString' in 'd', which is of non-class type 'int'
   20 |         answer=a.ToString()+"+"+b.ToString()+"+"+c.ToString()+"+"+d.ToString()+"=7"
      |                                                                     ^~~~~~~~
a.cc:24:9: error: 'answer' was not declared in this scope
   24 |         answer=a.ToString()+"+"+b.ToString()+"+"+c.ToString()+"-"+d.ToString()+"=7"
      |         ^~~~~~
a.cc:24:18: error: request for member 'ToString' in 'a', which is of non-class type 'int'
   24 |         answer=a.ToString()+"+"+b.ToString()+"+"+c.ToString()+"-"+d.ToString()+"=7"
      |                  ^~~~~~~~
a.cc:24:35: error: request for member 'ToString' in 'b', which is of non-class type 'int'
   24 |         answer=a.ToString()+"+"+b.ToString()+"+"+c.ToString()+"-"+d.ToString()+"=7"
      |                                   ^~~~~~~~
a.cc:24:52: error: request for member 'ToString' in 'c', which is of non-class type 'int'
   24 |         answer=a.ToString()+"+"+b.ToString()+"+"+c.ToString()+"-"+d.ToString()+"=7"
      |                                                    ^~~~~~~~
a.cc:24:69: error: request for member 'ToString' in 'd', which is of non-class type 'int'
   24 |         answer=a.ToString()+"+"+b.ToString()+"+"+c.ToString()+"-"+d.ToString()+"=7"
      |                                                                     ^~~~~~~~
a.cc:28:9: error: 'answer' was not declared in this scope
   28 |         answer=a.ToString()+"+"+b.ToString()+"-"+c.ToString()+"+"+d.ToString()+"=7"
      |         ^~~~~~
a.cc:28:18: error: request for member 'ToString' in 'a', which is of non-class type 'int'
   28 |         answer=a.ToString()+"+"+b.ToString()+"-"+c.ToString()+"+"+d.ToString()+"=7"
      |                  ^~~~~~~~
a.cc:28:35: error: request for member 'ToString' in 'b', which is of non-class type 'int'
   28 |         answer=a.ToString()+"+"+b.ToString()+"-"+c.ToString()+"+"+d.ToString()+"=7"
      |                                   ^~~~~~~~
a.cc:28:52: error: request for member 'ToString' in 'c', which is of non-class type 'int'
   28 |         answer=a.ToString()+"+"+b.ToString()+"-"+c.ToString()+"+"+d.ToString()+"=7"
      |                                                    ^~~~~~~~
a.cc:28:69: error: request for member 'ToString' in 'd', which is of non-class type 'int'
   28 |         answer=a.ToString()+"+"+b.ToString()+"-"+c.ToString()+"+"+d.ToString()+"=7"
      |                                                                     ^~~~~~~~
a.cc:32:9: error: 'answer' was not declared in this scope
   32 |         answer=a.ToString()+"+"+b.ToString()+"-"+c.ToString()+"-"+d.ToString()+"=7"
      |         ^~~~~~
a.cc:32:18: error: request for member 'ToString' in 'a', which is of non-class type 'int'
   32 |         answer=a.ToString()+"+"+b.ToString()+"-"+c.ToString()+"-"+d.ToString()+"=7"
      |                  ^~~~~~~~
a.cc:32:35: error: request for member 'ToString' in 'b', which is of non-class type 'int'
   32 |         answer=a.ToString()+"+"+b.ToString()+"-"+c.ToString()+"-"+d.ToString()+"=7"
      |                                   ^~~~~~~~
a.cc:32:52: error: request for member 'ToString' in 'c', which is of non-class type 'int'
   32 |         answer=a.ToString()+"+"+b.ToString()+"-"+c.ToString()+"-"+d.ToString()+"=7"
      |                                                    ^~~~~~~~
a.cc:32:69: error: request for member 'ToString' in 'd', which is of non-class type 'int'
   32 |         answer=a.ToString()+"+"+b.ToString()+"-"+c.ToString()+"-"+d.ToString()+"=7"
      |                                                                     ^~~~~~~~
a.cc:36:9: error: 'answer' was not declared in this scope
   36 |         answer=a.ToString()+"-"+b.ToString()+"+"+c.ToString()+"+"+d.ToString()+"=7"
      |         ^~~~~~
a.cc:36:18: error: request for member 'ToString' in 'a', which is of non-class type 'int'
   36 |         answer=a.ToString()+"-"+b.ToString()+"+"+c.ToString()+"+"+d.ToString()+"=7"
      |                  ^~~~~~~~
a.cc:36:35: error: request for member 'ToString' in 'b', which is of non-class type 'int'
   36 |         answer=a.ToString()+"-"+b.ToString()+"+"+c.ToString()+"+"+d.ToString()+"=7"
      |                                   ^~~~~~~~
a.cc:36:52: error: request for member 'ToString' in 'c', which is of non-class type 'int'
   36 |         answer=a.ToString()+"-"+b.ToString()+"+"+c.ToString()+"+"+d.ToString()+"=7"
      |                                                    ^~~~~~~~
a.cc:36:69: error: request for member 'ToString' in 'd', which is of non-class type 'int'
   36 |         answer=a.ToString()+"-"+b.ToString()+"+"+c.ToString()+"+"+d.ToString()+"=7"
      |                                                                     ^~~~~~~~
a.cc:40:9: error: 'answer' was not declared in this scope
   40 |         answer=a.ToString()+"-"+b.ToString()+"+"+c.ToString()+"-"+d.ToString()+"=7"
      |         ^~~~~~
a.cc:40:18: error: request for member 'ToString' in 'a', which is of non-class type 'int'
   40 |         answer=a.ToString()+"-"+b.ToString()+"+"+c.ToString()+"-"+d.ToString()+"=7"
      |                  ^~~~~~~~
a.cc:40:35: error: request for member 'ToString' in 'b', which is of non-class type 'int'
   40 |         answer=a.ToString()+"-"+b.ToString()+"+"+c.ToString()+"-"+d.ToString()+"=7"
      |                                   ^~~~~~~~
a.cc:40:52: error: request for member 'ToString' in 'c', which is of non-class type 'int'
   40 |         answer=a.ToString()+"-"+b.ToString()+"+"+c.ToString()+"-"+d.ToString()+"=7"
      |                                                    ^~~~~~~~
a.cc:40:69: error: request for member 'ToString' in 'd', which is of non-class type 'int'
   40 |         answer=a.ToString()+"-"+b.ToString()+"+"+c.ToString()+"-"+d.ToString()+"=7"
      |                                                                     ^~~~~~~~
a.cc:44:9: error: 'answer' was not declared in this scope
   44 |         answer=a.ToString()+"-"+b.ToString()+"-"+c.ToString()+"+"+d.ToString()+"=7"
      |         ^~~~~~
a.cc:44:18: error: request for member 'ToString' in 'a', which is of non-class type 'int'
   44 |         answer=a.ToString()+"-"+b.ToString()+"-"+c.ToString()+"+"+d.ToString()+"=7"
      |                  ^~~~~~~~
a.cc:44:35: error: request for member 'ToString' in 'b', which is of non-class type 'int'
   44 |         answer=a.ToString()+"-"+b.ToString()+"-"+c.ToString()+"+"+d.ToString()+"=7"
      |                                   ^~~~~~~~
a.cc:44:52: error: request for member 'ToString' in 'c', which is of non-class type 'int'
   44 |         answer=a.ToString()+"-"+b.ToString()+"-"+c.ToString()+"+"+d.ToString()+"=7"
      |                                                    ^~~~~~~~
a.cc:44:69: error: request for member 'ToString' in 'd', which is of non-class type 'int'
   44 |         answer=a.ToString()+"-"+b.ToString()+"-"+c.ToString()+"+"+d.ToString()+"=7"
      |                                                                     ^~~~~~~~
a.cc:48:9: error: 'answer' was not declared in this scope
   48 |         answer=a.ToString()+"-"+b.ToString()+"-"+c.ToString()+"-"+d.ToString()+"=7"
      |         ^~~~~~
a.cc:48:18: error: request for member 'ToString' in 'a', which is of non-class type 'int'
   48 |         answer=a.ToString()+"-"+b.ToString()+"-"+c.ToString()+"-"+d.ToString()+"=7"
      |                  ^~~~~~~~
a.cc:48:35: error: request for member 'ToString' in 'b', which is of non-class type 'int'
   48 |         answer=a.ToString()+"-"+b.ToString()+"-"+c.ToString()+"-"+d.ToString()+"=7"
      |                                   ^~~~~~~~
a.cc:48:52: error: request for member 'ToString' in 'c', which is of non-class type 'int'
   48 |         answer=a.ToString()+"-"+b.ToString()+"-"+c.ToString()+"-"+d.ToString()+"=7"
      |                                                    ^~~~~~~~
a.cc:48:69: error: request for member 'ToString' in 'd', which is of non-class type 'int'
   48 |         answer=a.ToString()+"-"+b.ToString()+"-"+c.ToString()+"-"+d.ToString()+"=7"
      |                                                                     ^~~~~~~~
a.cc:51:17: error: 'Console' was not declared in this scope
   51 |                 Console.WriteLine(answer);/