Submission

Status:

----------

Subtask/Task Score:

0/100

Score: 0

User: windsurf

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

Language: cpp

Time: 0.003 second

Submitted On: 2025-12-27 11:10:18

#include <bits/stdc++.h>
using namespace std;
int main() {
    
    int x, y, z;
    
    cin >> z  >> x >> y ;
    
    if(z = 1)
    {
        cout << x+y;
    }
    else
    if(z = 2)
    {
        cout << x-y;
    }
    else 
    if(z = 3)
    {
        cout << x*y;
    }
    else
    if(z = 4)
    {
    	if(y=0)
    	{
    		cout << "cannot divide by zero";
		}
		else
		{
        cout << x/y;
        }
    }
    else
    if(z = 5)
    {
    	if(y = 0)
    	{
    		cout << "cannot divide by zero";
		}
		else
		{
        cout << x%y;
        }
	}
    
    
}