Bestimmter Command, bestimmte Antwort von Programm



  • Hey leute ähm ich weiß jetzt nicht ob der text oben ganz stimmt aber ich suche einen code um auf einen bestimmten command eine bestimmte antwort vom programm zu bekommen.

    also z.b. ich gebe ins programm "binomischeformel1" ein gibt er aus "(a+b)*(a+b)"

    ich hab schon ziemlich lang gegoogled und bin ein Einsteiger.
    hoffentlich könnt ihr mir helfen. ich habs auch schon mit if probiert.



  • #include <iostream>
    #include <string>
    using namespace std;
    
    int main()
    {
        string cmd{ "binomischeformel1" };
        if( cmd == "binomischeformel1" )
            cout << "(a+b)*(a+b)";
    }
    
    


  • danke


Log in to reply