Language: C++

#include<iostream>
using namespace std;
int main()
{
    string s;
    cin >> s;
    int a;
    if(s = "000"){
      a = 0;
    }else if(s = "100" || s = "010" || s = "001"){
      a = 1;
    }else if(s = "101" || s = "110" || s = "011"){
      a = 2;
    }else{
      a = 3;
    }
    cout << a << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: could not convert 's.std::__cxx11::basic_string<char>::operator=(((const char*)"000"))' from 'std::__cxx11::basic_string<char>' to 'bool'
    8 |     if(s = "000"){
      |        ~~^~~~~~~
      |          |
      |          std::__cxx11::basic_string<char>
a.cc:10:24: error: no match for 'operator||' (operand types are 'const char [4]' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   10 |     }else if(s = "100" || s = "010" || s = "001"){
      |                  ~~~~~ ^~ ~
      |                  |        |
      |                  |        std::string {aka std::__cxx11::basic_string<char>}
      |                  const char [4]
a.cc:10:24: note: candidate: 'operator||(bool, bool)' (built-in)
   10 |     }else if(s = "100" || s = "010" || s = "001"){
      |                  ~~~~~~^~~~
a.cc:10:24: note:   no known conversion for argument 2 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
a.cc:10:37: error: no match for 'operator||' (operand types are 'const char [4]' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   10 |     }else if(s = "100" || s = "010" || s = "001"){
      |                               ~~~~~ ^~ ~
      |                               |        |
      |                               |        std::string {aka std::__cxx11::basic_string<char>}
      |                               const char [4]
a.cc:10:37: note: candidate: 'operator||(bool, bool)' (built-in)
   10 |     }else if(s = "100" || s = "010" || s = "001"){
      |                               ~~~~~~^~~~
a.cc:10:37: note:   no known conversion for argument 2 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
a.cc:12:24: error: no match for 'operator||' (operand types are 'const char [4]' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   12 |     }else if(s = "101" || s = "110" || s = "011"){
      |                  ~~~~~ ^~ ~
      |                  |        |
      |                  |        std::string {aka std::__cxx11::basic_string<char>}
      |                  const char [4]
a.cc:12:24: note: candidate: 'operator||(bool, bool)' (built-in)
   12 |     }else if(s = "101" || s = "110" || s = "011"){
      |                  ~~~~~~^~~~
a.cc:12:24: note:   no known conversion for argument 2 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
a.cc:12:37: error: no match for 'operator||' (operand types are 'const char [4]' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   12 |     }else if(s = "101" || s = "110" || s = "011"){
      |                               ~~~~~ ^~ ~
      |                               |        |
      |                               |        std::string {aka std::__cxx11::basic_string<char>}
      |                               const char [4]
a.cc:12:37: note: candidate: 'operator||(bool, bool)' (built-in)
   12 |     }else if(s = "101" || s = "110" || s = "011"){
      |                               ~~~~~~^~~~
a.cc:12:37: note:   no known conversion for argument 2 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool'