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 potter_here at 2012-10-14 13:34:39 on Problem 1028
#include<stdio.h>
#include<string.h>

int main()
{
	int count=0,max;
	char str[100][70];
	char cmd[12],get[80];

	strcpy(str[0],"http://www.acm.org/");
	while(scanf("%s",cmd))
	{
		if(cmd[0]=='Q')
			break;
		if(cmd[0]=='V')
		{
			getchar();
			gets(get);
			count++;
			max=0;
			if(count>max)
				max=count;
			strcpy(str[count],get);
			printf("%s\n",str[count]);
		}
		if(cmd[0]=='B')
		{
			count--;
			if(count>=0){
				printf("%s\n",str[count]);
			}
			else
			{
				printf("Ignored\n");
				count++;
			}
		}
		if(cmd[0]=='F')
		{
			count++;
			if(max>=count)
			{
				printf("%s\n",str[count]);
			}
			else
			{
				printf("Ignored\n");
				count--;
			}
		}
	}
	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