Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Karatat007

Problemset: เส้นทางคณิตศาสตร์

Language: cpp

Time: 0.002 second

Submitted On: 2026-10-08 10:25:05

#include <bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int x,y,z;
    cin >> x >> y >> z;
    if(z == 1) cout << x+y;
    else if(z == 2) cout << x-y;
    else if(z == 3) cout << x*y;
    else if(z == 5) cout << x%y;
    else if(z == 4 and y != 0) cout << x/y;
    else cout << "cannot divide by zero";
}