Snap! if Statement in C++

How would you make the Snap! if statement in C++, like how you can do this with JS.

What I have tried:

     // ifc if1 if2 ifcheck ifdo
      cin >> if1;
      cin >> ifc;
      cin >> if2;
      cin >> ifdo;
      if(ifdo == "DO"){
        cin>>ifdo;
      }
      if(ifc == "="){
        if(if1 == if2){
          input = ifdo;
        } else {}
      } else if(ifc == "!="){
        if(if1 != if2){
          
        } else if(if1 == if2){} else{cout << "\033[31m"
             << "\033[101m";
        cout << "ERROR 409, TRY: '=' '!='" << endl;
        cout << "\033[0m";
        errors = errors + 1;}
      }
    }

Hello this is Gulshan
Well, you can try below code instead of above, I am sure you will get what you are looking for.

#include <iostream>
#include <string>

int main() {
    std::string if1, ifc, if2, ifdo;
    std::string input;

    std::cin >> if1;
    std::cin >> ifc;
    std::cin >> if2;
    std::cin >> ifdo;

    if (ifdo == "DO") {
        std::cin >> ifdo;
    }

    if (ifc == "=") {
        if (if1 == if2) {
            input = ifdo;
        } else {
            // Handle the case when if1 is not equal to if2
        }
    } else if (ifc == "!=") {
        if (if1 != if2) {
            // Handle the case when if1 is not equal to if2
        } else if (if1 == if2) {
            // Handle the case when if1 is equal to if2
        } else {
            std::cout << "\033[31m" << "\033[101m";
            std::cout << "ERROR 409, TRY: '=' '!='" << std::endl;
            std::cout << "\033[0m";
            errors = errors + 1;
        }
    }

    return 0;
}

Thanks