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

注意!BACK和FORWARD都要Ignored,附代码

Posted by qitaishui at 2012-02-03 23:25:39 on Problem 1028
#include<stdio.h>
#include<string.h>
int main()
{
	char a[105][80],w[10],top,temp;
	strcpy(a[1],"http://www.acm.org/");
	scanf("%s",w);
	top=temp=1;
	while(strcmp(w,"QUIT")){
		if(!strcmp(w,"VISIT")){
			top=temp;
			top++;
			temp=top;
			scanf("%s",a[top]);
			printf("%s\n",a[top]);
		}
		if(!strcmp(w,"BACK")){
			if(temp-1>0)
				temp--,printf("%s\n",a[temp]);
			else
				printf("Ignored\n");
		}
		if(!strcmp(w,"FORWARD")){
			if(temp+1<=top){
				temp++;
				printf("%s\n",a[temp]);
			}
			else
				printf("Ignored\n");
		}
		scanf("%s",w);
	}
}

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