Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:那位哥哥帮忙看看啊~~~~~~~~~~~~~WA得我疯了!!!!谢谢拉

Posted by niuniu2006 at 2007-09-26 20:56:12 on Problem 1028
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator