标签:
1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 using namespace std; 5 int main() 6 { 7 int M1,M2; 8 while(cin>>M1>>M2) 9 { 10 int i; 11 int R1=0,R2=0,R3=0; 12 getchar(); 13 char a[201]; 14 gets(a); 15 for(i=0;a[i]!=‘\0‘;i++) 16 { 17 if(a[i]==‘A‘) 18 R1=M1; 19 if(a[i]==‘B‘) 20 R2=M2; 21 if(a[i]==‘C‘) 22 M1=R3; 23 if(a[i]==‘D‘) 24 M2=R3; 25 if(a[i]==‘E‘) 26 R3=R1+R2; 27 if(a[i]==‘F‘) 28 R3=R1-R2; 29 } 30 cout<<M1<<‘,‘<<M2<<endl; 31 } 32 }
标签:
原文地址:http://www.cnblogs.com/a1225234/p/4584573.html