delete pics to save space
This commit is contained in:
21
history_source/信息学奥赛一本通/1.3.9.cpp
Normal file
21
history_source/信息学奥赛一本通/1.3.9.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
#include<cstdio>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
int a,b;
|
||||
char f;
|
||||
scanf("%d%c%d",&a,&f,&b);
|
||||
switch(f)
|
||||
{
|
||||
case '+':printf("%d\n",a+b);break;
|
||||
case '-':printf("%d\n",a-b);break;
|
||||
case '*':printf("%d\n",a*b);break;
|
||||
case '/':
|
||||
if(b==0) printf("Divided by zero!\n");
|
||||
else printf("%d\n",a/b);
|
||||
break;
|
||||
default:printf("Invalid operator!\n");j
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user