Submission

Status:

PPPP-PPPPP

Subtask/Task Score:

90/100

Score: 90

User: iAOMNC

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

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-16 16:46:58

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

int main()
{
    int x,y,z;
    cin >> x >> y >> z;
    if(z==1)
    {
    cout << x+y;
    return 0;
    }
    if(z==2)
    {
    cout << x-y;
    return 0;
    }
    if(z==3)
    {
    cout << x*y;
    return 0;
    }
    if(z==4&&y!=0)
    {
    cout << x/y;
    return 0;
    }
    cout << "cannot divide by zero";
    return 0;
}