HDU ACM 1073 Online Judge ->字符串水题

分析:水题。

#include<iostream>
using namespace std;

#define N 5050
char a[N],b[N],tmp[N];

void Read(char p[])
{
	getchar();
	gets(tmp);
	while(gets(tmp))
	{
		if(strcmp(tmp,"END")==0) break;
		if(strlen(tmp)!=0) strcat(p,tmp);
		strcat(p,"
");
	}
}

void Process(char p[])
{
	int i,k,len;

	k=0;
	len=strlen(p);
	for(i=0;i<len;i++)
		if(p[i]!=' '&&p[i]!='	'&&p[i]!='
')
			p[k++]=p[i];
	p[k]='';
}

int main()      
{
	int T;

	cin>>T;
	while(T--)
	{
		a[0]='';
		b[0]='';
		Read(a);
		Read(b);
		if(strcmp(a,b)==0)
		{
			puts("Accepted");
			continue;
		}
		else
		{
			Process(a);
			Process(b);
			if(strcmp(a,b)==0)
			{
				puts("Presentation Error");
				continue;
			}
		}
		puts("Wrong Answer");
	}
    return 0;      
}


原文地址:https://www.cnblogs.com/gcczhongduan/p/5271566.html