www.pudn.com > zju_1000_1010.rar > 1005.CPP
#include#include struct so{ int a,b,point,sol; }; so num[200]; int q1,q2,q3; int A,B,N; int same(int t){ for(int i=1;i 0&&num[i].b0&&num[i].a>A>>B>>N){ int tem=doing(); int cou=0; int res[20]; while(tem>1){ cou++;res[cou]=num[tem].sol;tem=num[tem].point;} for(int j=cou;j>=1;j--){ switch(res[j]){ case 1: cout<<"fill A\n";break; case 2: cout<<"empty A\n";break; case 3: cout<<"fill B\n";break; case 4: cout<<"empty B\n";break; case 5: cout<<"pour A B\n";break; case 6: cout<<"pour B A\n";break;}} cout<<"success\n"; } return 0; }