Home Article Practice 老六

老六

2024-11-02 20:34  views:131  source:13888510299    

#include<bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
int a[10000];
string s1,s2,s3,s4;
signed main(){
int x,y;
char f;
cin>>x>>y>>f;
switch(f){
case'+':
cout<<x+y;
break;
case'-':
cout<<x-y;
break;
case'*':
cout<<x*y;
break;
case'/':
if(y==0){
cout<<"Divided by zero!";
}
else{
cout<<x/y;
}
break;
default :
cout<<"Invalid operator!";
}
return 0;
}



Disclaimer: The above articles are added by users themselves and are only for typing and communication purposes. They do not represent the views of this website, and this website does not assume any legal responsibility. This statement is hereby made! If there is any infringement of your rights, please contact us promptly to delete it.

字符:    改为:
去打字就可以设置个性皮肤啦!(O ^ ~ ^ O)