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 13107222 at 2008-12-17 11:49:28 on Problem 1028
#include"stdio.h"
#include"string.h"
void main()
{
	char a[120][120];
	char r[120][120];
	char s[120];
	int i,j=0,max=0;
	strcpy(a[0],"http://www.acm.org/");
	i=0;
	while(gets(s)&&s[0]!='Q')
	{
		if(s[0]=='V')
		{
			i++;
			max=i;
		strcpy(a[i],s+6);
			strcpy(r[j++],a[i]);
			continue;
		}
		if(s[0]=='F')
		{
			i++;			
			if(i>max)
			{
					i=max;
					strcpy(r[j++],"Ignored");
			}
			else
			
				strcpy(r[j++],a[i]);
			continue;
		}
		if(s[0]=='B')
		{
			i--;
			if(i==-1)
			{
				i=0;
				strcpy(r[j++],"Ignored");
			}
			else
					strcpy(r[j++],a[i]);
		}
	}
	for(i=0;i<j;i++)
		printf("%s\n",r[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