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. mysql修改编码

    1.查看当前编码 2.设置utf8mb4编码(也可以是其他),修改my.cnf或my.ini

  2. 如何设置linux的文件和目录的权限

    1 字符表示法 1)chmod [-R] 权限(mode)file   注:[-R]会将目录下所有权限都设置成指定的 who operator permission u(owner) +增加权限 r( ...

  3. hibernate 和 jdbc 优缺点对比

    jdbc缺点: 1.编程繁琐,用的try和catch比较多 2.jdbc没有对数据做缓存 3.没有做到面向对象编程 4.sql语句的跨平台性很差 jdbc优点: 效率比较高 hibernate的优点: ...

  4. redis13---事务处理。

    Jedis事务我们使用JDBC连接Mysql的时候,每次执行sql语句之前,都需要开启事务:在MyBatis中,也需要使用openSession()来获取session事务对象,来进行sql执行.查询 ...

  5. screen实现关闭ssh之后继续运行代码

    本文基于Ubuntu 14.04 使用SSH连接远程服务器,启动服务,退出SSH后,服务也就终止了,使用Screen可以解决这个问题. 1.安装Screen apt-get install scree ...

  6. ASP.NET Page执行顺序

    using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Secu ...

  7. [SOJ] 1282. Computer games (KMP)

    坑爹题 1282. Computer Game Constraints Time Limit: 1 secs, Memory Limit: 32 MB Description Brian is an ...

  8. Codeforces Round #256 (Div. 2) B Suffix Structures

    Description Bizon the Champion isn't just a bison. He also is a favorite of the "Bizons" t ...

  9. Linux下好用的简单实用命令

    1.你是否为在输入了一大串命令之后发现第一个字符打错了而苦恼?只能删除重来嘛?或者一步步左移光标? NO,一个组合键轻松搞定 Ctrl+A -----到命令行首 Ctrl+E ------到命令行末 ...

  10. 杭电20题 Human Gene Functions

    Problem Description It is well known that a human gene can be considered as a sequence, consisting o ...