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 tangjiming at 2008-04-08 16:49:33 on Problem 1028
In Reply To:那位哥哥帮忙看看啊~~~~~~~~~~~~~WA得我疯了!!!!谢谢拉 Posted by:trueshlqsh at 2007-09-20 20:04:29
感觉我的代码和你的差不多啊  竟然奇迹般的AC了。。。。。
#include<iostream>
#include<string>
using namespace std;
int main()
{
    string get,forward[100],back[100],now;
    int f=0,b=0;
    now="http://www.acm.org/";
    while(cin>>get,get!="QUIT")
    {
      if(get=="VISIT"){
                                back[++b]=now;
                                cin>>now;
                                cout<<now<<endl;
                                f=0;
                                continue;
                       }
                      
      if(get=="BACK"){
                                if(b==0) {printf("Ignored\n");continue;}
                                else {
                                       forward[++f]=now;
                                       now=back[b--];
                                       cout<<now<<endl;
                                       continue;
                                     }
                              }
      if(get=="FORWARD"){
                                  if(f==0) {printf("Ignored\n");continue;}
                                else {
                                       back[++b]=now;
                                       now=forward[f--];
                                       cout<<now<<endl;
                                       continue;
                                     }
                                 }
                               }
      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