#include <stdio.h>

main()                    /* einfacher Taschenrechner */
{
    double op1, op2;
    char op[2];

    printf("Eingabe: zahl <op> zahl ENTER\n\n");
    while(scanf("%lf %1s %lf", &op1, op, &op2) != EOF) {
        switch(op[0]) {
            case '+':
                op1 += op2;
                break;
            case '-':
                op1 -= op2;
                break;
            case '*':
                op1 *= op2;
                break;
            case '/':
                op1 /= op2;
                break;
            default:
                printf("illegal operator\n");
                continue;
        }
        printf(" = %g\n", op1);
    }
}
