OJ-Problems-Source/OpenJudge/ch0112_冰封/01.cpp

39 lines
732 B
C++
Raw Normal View History

2016-07-06 14:15:22 +08:00
#include<stdio.h>
#include<iostream>
using namespace std;
int main(void){
int m,n;
char a;
scanf("%d %c %d",&m,&a,&n);
switch(a){
case '+':
printf("%d",m+n);
break;
case '-':
printf("%d",m-n);
break;
case '*':
printf("%d",m*n);
break;
case '/':
if(n==0)break;
printf("%d",m/n);
break;
case '%':
if(n==0)break;
printf("%d",m%n);
break;
}
/* unsigned long long a = 1;
for(int i = 0; i < 100; i++){
a *= 10;
}
cout<<a;
*/
getchar();getchar();getchar();getchar();getchar();
return 0;
}