level 1
AM菜鸟
楼主
#include
#include
#include
using namespace std;class Box{public: Box(int a){num=a;} int getnum(){return num;}private:int num;};class Passage { public: Passage(Box* cbox){abox=cbox;pnext=NULL;ptou=NULL;} void setnext1(Passage* ppassage){pnext=ppassage;} void setnext2(Passage* pppassage){ptou=pppassage;} Passage* getnext(){return pnext;} Passage* gettou(){return ptou;} Box* getabox(){return abox;} private: Box* abox; Passage* pnext; Passage* ptou;};class Tuke{public:Tuke(){phead=pcurrent=pend=NULL;}void add(Box* pbox);Box* getfirstbox();Box* getendbox(); Box* getmillbox();void movebox();int judge();private:Passage* phead;Passage* pcurrent;Passage* pend;};void Tuke::add(Box* pbox){ Passage *passage=new Passage(pbox); if(pend!=NULL){ pend->setnext1(passage); pend=passage; pend->setnext2(pcurrent); } else {phead=passage;pend=passage;}pcurrent=pend;}Box* Tuke::getfirstbox(){return phead->getabox();} Box* Tuke::getmillbox(){ return pcurrent->getabox();}void Tuke::movebox(){pcurrent=pcurrent->gettou();}Box* Tuke::getendbox(){return pcurrent->getabox();}int Tuke::judge(){ int bol=phead==pcurrent?1:0;return bol;} int jia1(int a[],int m) { int sum=0; switch(m) { case 4: sum=a[0]*1e3+a[1]*1e2+a[2]*1e1+a[3];break; case 3: sum=a[0]*1e2+a[1]*1e1+a[2];break; case 2: sum=a[0]*1e1+a[1];break; case 1: sum=a[0];break; } return sum; } int jia2(int a[]) {int sum=0; sum=a[0]*1e3+a[1]*1e2+a[2]*1e1+a[3]; return sum; } int s,ss; void main(){ string count,count2; cin>>count>>count2; cout<<"the two number your insert is:"<<"\n"<
=count2.length()) { first=count.substr(1); second=count2.substr(1);} else {first=count2.substr(1); second=count.substr(1); } }if(count[0]!='-'&&count2[0]!='-'){ s=0; ss=0; if(count.length()>=count2.length()) { first=count; second=count2;} else {first=count2; second=count; } }if(count[0]=='-'&&count2[0]!='-'){ ss=1; third=count.substr(1); int jf; if(third.length()>count2.length()) {first=third; second=count2; s=1; } if(third.length()
count2[hj]?1:0; break; } } if(jf==1)
2007年10月23日 07点10分
1
#include
#include
using namespace std;class Box{public: Box(int a){num=a;} int getnum(){return num;}private:int num;};class Passage { public: Passage(Box* cbox){abox=cbox;pnext=NULL;ptou=NULL;} void setnext1(Passage* ppassage){pnext=ppassage;} void setnext2(Passage* pppassage){ptou=pppassage;} Passage* getnext(){return pnext;} Passage* gettou(){return ptou;} Box* getabox(){return abox;} private: Box* abox; Passage* pnext; Passage* ptou;};class Tuke{public:Tuke(){phead=pcurrent=pend=NULL;}void add(Box* pbox);Box* getfirstbox();Box* getendbox(); Box* getmillbox();void movebox();int judge();private:Passage* phead;Passage* pcurrent;Passage* pend;};void Tuke::add(Box* pbox){ Passage *passage=new Passage(pbox); if(pend!=NULL){ pend->setnext1(passage); pend=passage; pend->setnext2(pcurrent); } else {phead=passage;pend=passage;}pcurrent=pend;}Box* Tuke::getfirstbox(){return phead->getabox();} Box* Tuke::getmillbox(){ return pcurrent->getabox();}void Tuke::movebox(){pcurrent=pcurrent->gettou();}Box* Tuke::getendbox(){return pcurrent->getabox();}int Tuke::judge(){ int bol=phead==pcurrent?1:0;return bol;} int jia1(int a[],int m) { int sum=0; switch(m) { case 4: sum=a[0]*1e3+a[1]*1e2+a[2]*1e1+a[3];break; case 3: sum=a[0]*1e2+a[1]*1e1+a[2];break; case 2: sum=a[0]*1e1+a[1];break; case 1: sum=a[0];break; } return sum; } int jia2(int a[]) {int sum=0; sum=a[0]*1e3+a[1]*1e2+a[2]*1e1+a[3]; return sum; } int s,ss; void main(){ string count,count2; cin>>count>>count2; cout<<"the two number your insert is:"<<"\n"<
=count2.length()) { first=count.substr(1); second=count2.substr(1);} else {first=count2.substr(1); second=count.substr(1); } }if(count[0]!='-'&&count2[0]!='-'){ s=0; ss=0; if(count.length()>=count2.length()) { first=count; second=count2;} else {first=count2; second=count; } }if(count[0]=='-'&&count2[0]!='-'){ ss=1; third=count.substr(1); int jf; if(third.length()>count2.length()) {first=third; second=count2; s=1; } if(third.length()
count2[hj]?1:0; break; } } if(jf==1)