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

求各位大侠们帮助,我这代码意思很简单明确啊,为什么总是WA!!!!

Posted by CS2010 at 2011-07-23 12:05:56 on Problem 1028
#include"stdio.h"
#include"string.h"
int main()
{
	char url[200][100],a[10];int i;
	i=0;
	memset(url,'a',sizeof(url));
	strcpy(url[0],"http://www.acm.org/");
	while(1)
	{ 
		scanf("%s",a);
		if(strcmp(a,"VISIT")==0)
			{
				i++; 
				scanf("%s",url[i]);
				printf("%s\n",url[i]);
			}
		if(strcmp(a,"BACK")==0)
		{
			i--;
			if(i>=0)
				printf("%s\n",url[i]);
			else
				printf("Ignored\n");
			if(i<0) i=0;
		}
		if(strcmp(a,"FORWARD")==0)
		{
			i++;
			if(url[i][0]!='a')
				printf("%s\n",url[i]);
			else
			{
				printf("Ignored\n");
				i--;
			}
		}
		if(strcmp(a,"QUIT")==0)
			break;

	}
}

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