Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
836 B
0
Indexable
Never
#include <iostream>
using namespace std;
int main(){
    int k, a, b, n;
    cout << "Ban muon giai bai so may: ";
    cin >> k;
    switch(k){
        case 1:
            cout << "Nhap a va b: ";
            cin >> a >> b;
            cout << "a + b = " << a + b << endl;
            cout << "a - b = " << a - b << endl;
            cout << "a * b = " << a * b << endl;
            cout << "a / b = " << (float)a / b << endl;
            cout << "a % b = " << a % b;
            break;
        case 2:
            cout << "Nhap n: ";
            cin >> n;
            if(n % 2 == 0){
                cout << n << " la so chan";
            }
            else{
                cout << n << " la so le";
            }
            break;
        case 3:
            cout << "Nhap x: ";
            
    }
}
Leave a Comment