在线判题 (模拟)http://202.196.1.132/problem.php?id=1164

#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#define N 200010

void input(char s[])
{
    char str[N] = {0};
    while(gets(str), strcmp(str, "START"));/****/
    while(gets(str), strcmp(str, "END"))/****/
    {
        if(str[0] == 0)
            strcat(s, "
");
        else
            strcat(s, str);
    }
}//读入

void del(char s[])
{
    int i, j = 0;
    char s1[N] = {0};
    for(i = 0 ; s[i] != '' ; i++)
    {
        if(s[i] != ' ' && s[i] != '	' && s[i] != '
')
            s1[j++] = s[i];
    }
    s1[j + 1] = '
';
    strcpy(s, s1);
}//删除空格,制表符,回车

int judge(char a[], char b[])
{
    if(strcmp(a, b) == 0)
        return 1;
    del(a);
    del(b);
    if(strcmp(a, b) == 0)
        return 2;
    return 0;
}//判断
int main()
{
    int n, i, m;
    char s1[N], s2[N];
    scanf("%d", &n);
    for(i = 0 ; i < n ; i++)
    {
        memset(s1, 0, sizeof(s1));
        memset(s2, 0, sizeof(s2));
        input(s1);
        input(s2);
        m = judge(s1, s2);
        if(m == 1)
            printf("Accepted
");
        else if(m == 2)
            printf("Presentation Error
");
        else
            printf("Wrong Answer
");
    }
    return 0;
}
原文地址:https://www.cnblogs.com/qq2424260747/p/4564355.html