题意:给一系列的输出和标准答案,比较二者是AC,PE或WA
字符串处理还是比较薄弱,目前没什么时间搞字符串专题,所以遇到一题就努力搞懂
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<queue>
#include<map>
using namespace std;
#define MOD 1000000007
const double eps=1e-;
#define cl(a) memset(a,0,sizeof(a))
#define ts printf("*****\n");
const int MAXN=;
char a1[MAXN],a2[MAXN],b1[MAXN],b2[MAXN];
int n,m,tt;
char temp[MAXN];
void in(char a[],char b[])
{
gets(temp);
while(strcmp(temp,"START")!=) gets(temp); //START之前的都去掉
while(gets(temp))
{
if(strcmp(temp,"END")==) break;
if(strlen(temp)!=) strcat(a,temp); //读入的不为换行符
strcat(a,"\n");
}
int t=;
for(int i=;i<strlen(a);i++)
{
if(a[i]!=' '&&a[i]!='\n'&&a[i]!='\t') //\t要加,因为题目中有要求,汗
{
b[t++]=a[i];
}
}
b[t]='\0'; //注意这个一定要加,否则没办法比较
}
int main()
{
int i,j,k;
#ifndef ONLINE_JUDGE
freopen("1.in","r",stdin);
#endif
scanf("%d",&tt);
while(tt--)
{
a1[]='\0';
a2[]='\0';
in(a1,b1);
in(a2,b2);
if(strcmp(a1,a2)==) printf("Accepted\n"); //未被删除格式前都相同,说明完全相同
else if(strcmp(b1,b2)==) printf("Presentation Error\n");
else printf("Wrong Answer\n");
}
}