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

使用VC调试没有问题呀!可是提交了以后却报告说我的结果错误,谁能帮忙看看

Posted by A0417017 at 2004-02-17 11:28:59 on Problem 1028
#include "stdio.h"
#include "string.h"

int main()
{
	char sitelist[100][71]={""};
	int  nownum=0;
	char command[71];
    strcpy(sitelist[nownum],"http://www.acm.org/");

	for(;;)
	{
		memset(command,0,0);
		gets(command);
		if(!strncmp(command,"VISIT",5))
		{
		   nownum++;
           strcpy(sitelist[nownum],command+6);
		   printf("%s\n",sitelist[nownum]);
		}
		else if(!strcmp(command,"BACK"))
		{
			nownum--;
			if(nownum>=0)
			{
				printf("%s\n",sitelist[nownum]);
			}
			else
			{
				nownum++;
				printf("%s\n","Ignored");
			}
		}
		else if(!strcmp(command,"FORWARD"))
		{
			nownum++;
			if(nownum<=70 && strcmp(sitelist[nownum],""))
				printf("%s\n",sitelist[nownum]);
			else
			{
				nownum--;
				printf("%s\n","Ignored");
			}
		}
		else if(!strcmp(command,"QUIT"))
		{
			return 0;
		}
		else
			continue;
	}
}

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