#include #include #include using namespace std; int main() { map amap; map bmap; int a,b; int na=-1,nb=-1,sa=-1,sb=-1; int cis=-1; while(true) { amap.clear(); bmap.clear(); a=-1; b=-1; na=-1; nb=-1; sa=-1; sb=-1; cis=-1; scanf("%d%d",&a,&b); if(a==0&&b==0)break; na=a; nb=b; int aindex=0,bindex=0; while(true) { //cout<<"while true begin"<::iterator itera= amap.find(b); map::iterator iterb= bmap.find(a); if( itera != amap.end() ) { //cout <<"b is in amap"<second; //cout<<"aindex "<second<second; //cout<<"aindex "<second<::iterator iter; for( iter = amap.begin(); iter != amap.end(); ++iter ) { cout << "Key: '" << iter->first << "', Value: " << iter->second << endl; } cout <first << "', Value: " << iter->second << endl; } */ cout << na << " needs " << sa<< " steps, "<< nb << " needs " << sb <<" steps, they meet at "<