#include <iostream>

int main() {
    std::cout << "Hallo! Sie koennen folgende Operationen ausfuehren: (+, -, *, /)\n";

    double ergebnis = 0;
    int zahl = 0;
    std::string operation = "";

    while (operation != "=")
    {
        std::cout << "Aktuelles Ergebnis: " << ergebnis << "\n";

        std::cout << "Operation: ";
        std::cin >> operation;        
        
        if (operation != "=")
        {
        std::cout << "Zahl: ";
        std::cin >> zahl;
        }

        if (operation == "+")
        {
            ergebnis = ergebnis + zahl;
        } 
        else if (operation == "-")
        {
            ergebnis = ergebnis - zahl;
        }
        else if (operation == "*")
        {
            ergebnis = ergebnis * zahl;
        }
        else if (operation == "/")
        {
            if (zahl != 0)
            {
                ergebnis = ergebnis / zahl;
            }
            else
            {
                std::cout << "Division durch 0 nicht moeglich!\n";
            }
        }
        else if (operation != "=")
        {
            std::cout << "Das ist keine gueltige Operation!\n";
        }
    }

    std::cout << "Ergebnis: " << ergebnis << "\n";
}
