#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#define N 200010 void input(char s[])
{
char str[N] = {};
while(gets(str), strcmp(str, "START"));/****/
while(gets(str), strcmp(str, "END"))/****/
{
if(str[] == )
strcat(s, "\n");
else
strcat(s, str);
}
}//读入 void del(char s[])
{
int i, j = ;
char s1[N] = {};
for(i = ; s[i] != '\0' ; i++)
{
if(s[i] != ' ' && s[i] != '\t' && s[i] != '\n')
s1[j++] = s[i];
}
s1[j + ] = '\n';
strcpy(s, s1);
}//删除空格,制表符,回车 int judge(char a[], char b[])
{
if(strcmp(a, b) == )
return ;
del(a);
del(b);
if(strcmp(a, b) == )
return ;
return ;
}//判断
int main()
{
int n, i, m;
char s1[N], s2[N];
scanf("%d", &n);
for(i = ; i < n ; i++)
{
memset(s1, , sizeof(s1));
memset(s2, , sizeof(s2));
input(s1);
input(s2);
m = judge(s1, s2);
if(m == )
printf("Accepted\n");
else if(m == )
printf("Presentation Error\n");
else
printf("Wrong Answer\n");
}
return ;
}
04-20 19:18
查看更多