小计算器杀我
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
long long read(int);
void put(long long,int);
int main()
{
int n;
scanf("%d",&n);
getchar();
long long num1=0,num2=0;
bool bo;
int jz=10;
int i;
for(i=0; i<n; i++)
{
char s[20];
puts(s);
int taps;
if(s[0]=='C'&&s[1]=='L')
bo=0;
else if(s[0]=='N')
{
if(bo)
{
num2 = read(jz);
if(taps == 1)
num1 += num2;
if(taps == 2)
num1 -= num2;
if(taps == 3)
num1 *= num2;
if(taps == 4)
num1 /= num2;
if(taps == 5)
num1 %= num2;
}
else
{
num1 = read(jz);
bo = 1;
}
}
else if(s[0] == 'A')
taps = 1;
else if(s[0] == 'S')
taps = 2;
else if(s[0] == 'M' && s[1] == 'U')
taps = 3;
else if(s[0] == 'D')
taps = 4;
else if(s[0] == 'M' && s[1] == 'O')
taps = 5;
else if(s[0] == 'C' && s[1] == 'H')
scanf("%d",&jz);
else if(s[0] == 'E')
{
printf("%s",put(num1, jz));
}
}
return 0;
}