Problem Description
Ignatius is building an Online Judge, now he has worked out all the problems except the Judge System. The system has to read data from correct output file and user's result file, then the system compare the two files. If the two files are absolutly same, then the Judge System return "Accepted", else if the only differences between the two files are spaces(' '), tabs('\t'), or enters('\n'), the Judge System should return "Presentation Error", else the system will return "Wrong Answer".
Given the data of correct output file and the data of user's result file, your task is to determine which result the Judge System will return.
 
Input
The input contains several test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow. Each test case has two parts, the data of correct output file and the data of the user's result file. Both of them are starts with a single line contains a string "START" and end with a single line contains a string "END", these two strings are not the data. In other words, the data is between the two strings. The data will at most 5000 characters.
 
Output
For each test cases, you should output the the result Judge System should return.
 
Sample Input
4
START
1 + 2 = 3
END
START
1+2=3
END
START
1 + 2 = 3
END
START
1 + 2 = 3
 
END
START
1 + 2 = 3
END
START
1 + 2 = 4
END
START
1 + 2 = 3
END
START
1 + 2 = 3
END
 
Sample Output
Presentation Error
Presentation Error
Wrong Answer
Presentation Error
 
 
//开始怀疑自己的智商了
//'\t'水平制表(跳到下一个tab位置)
 
#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std; int main()
{
char data1[],ch[],data2[],p1[],p2[];
int t;
cin>>t;
getchar();
while(t--)
{
memset(data1,,sizeof(data1));
memset(data2,,sizeof(data2));
while(gets(ch))
{
if(strcmp(ch,"\0")==)
{ch[]=' ';
ch[]='\0';}
strcat(data1,ch);
if(strcmp(ch,"END")==)
break;
}
while(gets(ch))
{
if(strcmp(ch,"\0")==)
{ch[]=' ';
ch[]='\0';}
strcat(data2,ch);
if(strcmp(ch,"END")==)
break;
}
//cout<<data1<<endl;
//cout<<data2<<endl;
if(strcmp(data1,data2)==)
cout<<"Accepted"<<endl;
else
{
int j,k;
j=;k=;
for(int i=;i<strlen(data1);i++)
{
if(data1[i]!=' '&&data1[i]!='\t')
{
p1[j]=data1[i];
j++;
}
}
p1[j]='\0';
for(int i=;i<strlen(data2);i++)
{
if(data2[i]!=' '&&data2[i]!='\t')
{
p2[k]=data2[i];
k++;
}
}
p2[k]='\0';
//cout<<p1<<endl;
//cout<<p2<<endl;
if(strcmp(p1,p2)==)
cout<<"Presentation Error"<<endl;
else
cout<<"Wrong Answer"<<endl;
} }
return ;
}
 

HDU1073:Online Judge的更多相关文章

  1. Gym 101102C---Bored Judge(区间最大值)

    题目链接 http://codeforces.com/gym/101102/problem/C problem description Judge Bahosain was bored at ACM ...

  2. NOJ 1074 Hey Judge(DFS回溯)

    Problem 1074: Hey Judge Time Limits:  1000 MS   Memory Limits:  65536 KB 64-bit interger IO format: ...

  3. 【教程】如何正确的写一个Lemon/Cena的SPJ(special judge)

    转自:http://www.cnblogs.com/chouti/p/5752819.html Special Judge:当正确的输出结果不唯一的时候需要的自定义校验器 首先有个框架 #includ ...

  4. 九度 Online Judge 之《剑指 Offer》一书相关题目解答

    前段时间准备华为机试,正好之前看了一遍<剑指 Offer>,就在九度 Online Judge 上刷了书中的题目,使用的语言为 C++:只有3题没做,其他的都做了. 正如 Linus To ...

  5. UVa Online Judge 工具網站

    UVa Online Judge 工具網站   UVa中译题uHuntAlgorithmist Lucky貓的ACM園地,Lucky貓的 ACM 中譯題目 Mirror UVa Online Judg ...

  6. [swustoj 1021] Submissions of online judge

    Submissions of online judge(1021) 问题描述 An online judge is a system to test programs in programming c ...

  7. HDOJ/HDU 1073 Online Judge(字符串处理~)

    Problem Description Ignatius is building an Online Judge, now he has worked out all the problems exc ...

  8. write a macro to judge big endian or little endian

    Big endian means the most significant byte stores first in memory. int a=0x01020304, if the cpu is b ...

  9. UVA 489-- Hangman Judge(暴力串处理)

     Hangman Judge  In ``Hangman Judge,'' you are to write a program that judges a series of Hangman gam ...

随机推荐

  1. python 基础学习2--编程

    python编程的步骤为: __name__ 指示模块如何被加载:如果模块被导入,__name__的值是模块的名称,如果模块被直接执行,__name__的值是main 变量不用进行声明,直接赋值:无需 ...

  2. Fighting For 2017 Season Contest 1

    比赛地址[https://vjudge.net/contest/147011#problem/A].960626 题目一:[http://codeforces.com/problemset/probl ...

  3. VMware安装Centos6.8设置ip无法远程连接问题

    今天使用VMware安装Centos6.8minimal版本再设置ip地址的时候遇到了一些麻烦,就是无法ping通Centos操作系统的配置的ip从而无法用Xshell远程连接上. 如何配置请看下面的 ...

  4. sql 将某列转换成一个字符串 for xml path用法

    declare @test table( name varchar(10)) insert into @test values('a') insert into @test values('b') i ...

  5. intellij idea 12 搭建maven web项目 freemarker + spring mvc

    配置spring mvc ,写这篇文章的时候spring已经出了4.0 这里还是用稳定的3.2.7.RELEASE,先把spring和freemarker配置好 1.spring mvc配置 在web ...

  6. vs2008试用版的评估期已经结束解决办法

    1.控制面板----程序和功能----找到VS2008,打开"卸载/更改". 2.下载补丁:files.cnblogs.com/elaky/PatchVS2008.zip 打补丁之 ...

  7. 第四十七节,random 随机数模块

    random 随机数模块格式: import random 引入随机模块文件 random.randrange(65,91) 调用随机函数random.randrange(随机数开始范围,随机数结束范 ...

  8. 2016 C++及系统软件技术大会亮点

    2016 C++及系统软件技术大会将于201610月28日-29日在上海举办!此次2016 C++及系统软件技术大会秉承"全球专家. 连接智慧"的理念!大会特邀C++之父Bjarn ...

  9. 微信支付错误两个问题的解决:curl出错,错误码:60

    如下是运行微信支付测试代码时出错代码: Warning: curl_setopt() expects parameter 2 to be long, string given in D:\wwwroo ...

  10. 串string (KMP)

    1.Definition 串string,是零个或多个字符组成的有限序列.一般记作S="a1a2a3...an",其中S是串名,双引号括起来的字符序列是串值:ai(1<= i ...