Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
int counter=0;
int A,B,C,D;
cin>>A>>B>>C>>D;
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"<<endl;
else if(A-B+C+D==7){
cout<<A-B+C+D="7"<<endl;}
else if(A+B-C-D==7){
cout<<A+B-C-D="7"<<endl;}
else if(A-B+C-D==7){
cout<<A-B+C-D="7"<<endl;}
else if(A-B-C+D==7){
cout<<A-B-C+D="7"<<endl;}
else if(A-B-C-D==7){
cout<<A-B-C-D="7"<<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>' and 'const char [2]')
    8 | cout<<A+B+C+D="7";}
      |               ^~~
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
                 from a.cc:1:
/usr/include/c++/14/ostream:458:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator=(std::basic_ostream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]'
  458 |       operator=(basic_ostream&& __rhs)
      |       ^~~~~~~~
/usr/include/c++/14/ostream:458:33: note:   no known conversion for argument 1 from 'const char [2]' to 'std::basic_ostream<char>&&'
  458 |       operator=(basic_ostream&& __rhs)
      |                 ~~~~~~~~~~~~~~~~^~~~~
a.cc:10:15: error: no match for 'operator=' (operand types are 'std::basic_ostream<char>' and 'const char [2]')
   10 | cout<<A+B+C-D="7";}
      |               ^~~
/usr/include/c++/14/ostream:458:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator=(std::basic_ostream<_CharT, _Traits>&&) [with _CharT = char; _Traits = std::char_traits<char>]'
  458 |       operator=(basic_ostream&& __rhs)
      |       ^~~~~~~~
/usr/include/c++/14/ostream:458:33: note:   no known conversion for argument 1 from 'const char [2]' to 'std::basic_ostream<char>&&'
  458 |       operator=(basic_ostream&& __rhs)
      |                 ~~~~~~~~~~~~~~~~^~~~~
a.cc:12:18: error: invalid operands of types 'const char [2]' and '<unresolved overloaded function type>' to binary 'operator<<'
   12 | cout<<A+B-C+D="7"<<endl;
      |               ~~~^~~~~~
a.cc:13:1: error: expected '}' before 'else'
   13 | else if(A-B+C+D==7){
      | ^~~~
a.cc:11:20: note: to match this '{'
   11 | else if(A+B-C+D==7){
      |                    ^
a.cc:14:18: error: invalid operands of types 'const char [2]' and '<unresolved overloaded function type>' to binary 'operator<<'
   14 | cout<<A-B+C+D="7"<<endl;}
      |               ~~~^~~~~~
a.cc:16:18: error: invalid operands of types 'const char [2]' and '<unresolved overloaded function type>' to binary 'operator<<'
   16 | cout<<A+B-C-D="7"<<endl;}
      |               ~~~^~~~~~
a.cc:18:18: error: invalid operands of types 'const char [2]' and '<unresolved overloaded function type>' to binary 'operator<<'
   18 | cout<<A-B+C-D="7"<<endl;}
      |               ~~~^~~~~~
a.cc:20:18: error: invalid operands of types 'const char [2]' and '<unresolved overloaded function type>' to binary 'operator<<'
   20 | cout<<A-B-C+D="7"<<endl;}
      |               ~~~^~~~~~
a.cc:22:18: error: invalid operands of types 'const char [2]' and '<unresolved overloaded function type>' to binary 'operator<<'
   22 | cout<<A-B-C-D="7"<<endl;}
      |               ~~~^~~~~~
a.cc:22:26: error: expected '}' at end of input
   22 | cout<<A-B-C-D="7"<<endl;}
      |                          ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^