AOJ Volume100-10010

http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=10010

#include <iostream>
using namespace std;

int main (int argc, const char * argv[])
{
    int read1,read2;
    char o;
    while (cin >> read1) {
        cin >> o;
        if (o == '?') {
            break;
        }
        cin >> read2;
        
        int sum = 0;
        switch (o) {
            case '+':
                sum = read1 + read2;
                break;
            case '-':
                sum = read1 - read2;
                break;
            case '/':
                sum = read1 / read2;
                break;
            case '*':
                sum = read1 * read2;
                break;
            default:
                break;
        }
        
        cout << sum << "\n";
        
        
    }
    
    return 0;
}
広告を非表示にする