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

哪位DD帮我看看吧!郁闷很久了,为什么WA

Posted by wyh0103 at 2010-06-06 11:47:26 on Problem 1028
#include <stdio.h>
int main()
{
    char s[100][70],c[10];
    int i=1;
    strcpy(s[1],"http://www.acm.org/");
    while(scanf("%s",c)&&strcmp(c,"QUIT"))
    {
        
        if(!strcmp(c,"VISIT"))
        {
            i++;
            scanf("%s",s[i]);
            printf("%s\n",s[i]);            
        }
        if(!strcmp(c,"BACK"))
        {
            if(strlen(s[--i])>0) 
            printf("%s\n",s[i]);
            else {printf("Ignored\n");i++;}
        }
        if(!strcmp(c,"FORWARD"))
        {
            if(strlen(s[++i])>0) 
            printf("%s\n",s[i]);
            else {printf("Ignored\n");i--;}
        }
    }
}

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