1 #include <iostream> 2 #include <string> 3 using namespace std; 4 int cal(string b) 5 { 6 int w; 7 if(b=="zero") w=0; 8 else if(b=="one")w=1; 9 else if(b=="two")w=2; 10 else if(b=="three") w=3; 11 else if(b=="four") w=4; 12 else if(b=="five") w=5; 13 else if(b=="six")w=6; 14 else if(b=="seven")w=7; 15 else if(b=="eight")w=8; 16 else if(b=="nine")w=9; 17 return w; 18 } 19 int main() 20 { 21 string b1,b2,b3,b4; 22 char op,a; 23 int x,y; 24 while(cin>>b1) 25 { 26 cin>>b2; 27 if(b2.length()==1) 28 { 29 op=b2[0]; 30 x=cal(b1); 31 } 32 else 33 { 34 x=cal(b1)*10+cal(b2); 35 cin>>op; 36 } 37 cin>>b3; 38 cin>>b4; 39 if(b4.length()==1) 40 { 41 y=cal(b3); 42 } 43 else 44 { 45 y=cal(b3)*10+cal(b4); 46 cin>>a; 47 } 48 int ans; 49 if(x+y==0) break; 50 if(op=='+') ans=x+y; 51 else if(op=='-') ans=x-y; 52 else if(op=='*') ans=x*y; 53 else if(op=='/') ans=x/y; 54 cout<<ans<<endl; 55 } 56 }