博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
HDU 1073 Online Judge (字符串处理,简单题)
阅读量:6250 次
发布时间:2019-06-22

本文共 2221 字,大约阅读时间需要 7 分钟。

Online Judge

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)

Total Submission(s): 3389    Accepted Submission(s): 1276

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
 

 

Author
Ignatius.L
 
 
 
简单的题目。
主要是加了字符'\n'
每行的结束我都加上了'\n'字符。
之后比较就可以了。
#include
#include
#include
#include
#include
using namespace std;const int MAXN=5050;char a1[MAXN],a2[MAXN];char b1[MAXN],b2[MAXN];char temp[MAXN];void input(char a[],char b[]){ gets(temp); while(strcmp(temp,"START")!=0)gets(temp); while(gets(temp)) { if(strcmp(temp,"END")==0)break; if(strlen(temp)!=0)strcat(a,temp); strcat(a,"\n"); } int t=0; int len=strlen(a); for(int i=0;i

 

转载地址:http://lqusa.baihongyu.com/

你可能感兴趣的文章
eclipse中tomcat能正常启动,在浏览器中不能打开问题
查看>>
基于Linux根据僵尸网络病毒平台《比尔盖茨》
查看>>
JNI编程(二) —— 让C++和Java相互调用(2)
查看>>
Android搜索框效果
查看>>
ReportMachine OCX
查看>>
IOS开发--待研究源码(持续添加更新)
查看>>
解读ASP.NET 5 & MVC6系列(9):日志框架
查看>>
LinkedHashMap及其源码分析
查看>>
Atitit.Gui控件and面板----数据库区-mssql 2008 权限 配置 报表查看成员
查看>>
环境配置
查看>>
codeforces 468B 2-sat
查看>>
php对uploads文件的处理问题的解决
查看>>
Python urllib简单使用
查看>>
Python - 001 - 类与实例间属性的理解
查看>>
C# 使用xenocode混淆加密【转】
查看>>
Java 内存溢出(java.lang.OutOfMemoryError)的常见情况和处理方式总结(转)
查看>>
JavaScript(ECMAScript) with 语句
查看>>
在小米工作是怎样一番体验?
查看>>
VS编译链接时错误(Error Link2005)的解决方法
查看>>
Oracle SQL Developer 连接 MySQL
查看>>