Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:那位哥哥帮忙看看啊~~~~~~~~~~~~~WA得我疯了!!!!谢谢拉In Reply To:那位哥哥帮忙看看啊~~~~~~~~~~~~~WA得我疯了!!!!谢谢拉 Posted by:trueshlqsh at 2007-09-20 20:04:29 > #include <iostream> > #include <string> > > using namespace std; > > string dataf[101],datab[101]; > int forward,back; > > int main() > { > string order,now; > cin>>order; > back=0;forward=0; > now="http://www.acm.org/"; > while (order!="QUIT") > { > //VISIT > if (order=="VISIT") > { > back++; > datab[back]=now; > forward=0; > cin>>now; > cout<<now<<endl; > } > //BACK > if (order=="BACK") > if (0==back) > cout<<"Ignored"<<endl; > else { > forward++; > dataf[forward]=now; > now=datab[back]; > back--; > cout<<now<<endl; > } > //FORWARD > if (order=="FORWARD") > if (0==forward) > cout<<"Igored"<<endl; > else { > back++; > datab[back]=now; > now=dataf[forward]; > forward--; > cout<<now<<endl; > } > cin>>order; > } > return 0; > } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator