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

附代码,0MS

Posted by LXY5201314 at 2018-01-24 01:09:03 on Problem 1028
#include<stdio.h>
#include<string.h>
char a[100];
char b[200][200];
int main()
{
    int i,j=0;
    strcpy(b[0],"http://www.acm.org/");
    while(1)
    {
        scanf("%s",a);
        if(strcmp(a,"QUIT")==0)break;
        if(strcmp(a,"VISIT")==0)
        {
            scanf("%s",b[++j]);i=j;
        }
        if(strcmp(a,"BACK")==0)j--;
        else if(strcmp(a,"FORWARD")==0)j++;
        if(j<0){j++;printf("Ignored\n");}
        else if(j>i){j--;printf("Ignored\n");}
        else printf("%s\n",b[j]);
    }
    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