博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
hdu 1073 字符串函数的应用
阅读量:7072 次
发布时间:2019-06-28

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

题目来源:

http://acm.hdu.edu.cn/showproblem.php?pid=1073

Online Judge

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

Total Submission(s): 4684    Accepted Submission(s): 1787

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
 

 代码如下:

1 #include
2 #include
3 #include
4 #include
5 #include
6 #include
7 #include
8 #define N 5020 9 using namespace std;10 void input(char *s)11 {12 char tmp[N];13 while(gets(tmp) && strcmp(tmp,"END"))14 {15 if(strlen(tmp)) strcat(s,tmp);16 strcat(s,"\n");17 }18 }19 void Delchar(char *s,int len)20 {21 char tmp[N];22 int t=0;23 for(int i=0;i

 

转载于:https://www.cnblogs.com/zn505119020/p/3584047.html

你可能感兴趣的文章
常识 跳转读取js函数
查看>>
Linux内核中的jiffies及其作用介绍及jiffies等相关函数详解
查看>>
Unity3D 事件处理函数
查看>>
unix编程高级io之epool
查看>>
linux系统硬件配置查看方法
查看>>
[转]PHP函数的实现原理及性能分析
查看>>
格式化数字
查看>>
linux 硬链接 软连接
查看>>
Redis配置详解-客户端缓冲区 output buffer
查看>>
Linux命令操作
查看>>
flutter 视频播放 VideoPlayController
查看>>
SQOOP导入mysql数据库乱码
查看>>
Hibernate_持久类的要求
查看>>
actor-sdk打包成javascript脚本文件
查看>>
IOS----IPhone中发送短信
查看>>
Redis数据备份与恢复
查看>>
Android Dialog里的EdiText为何不自动弹出输入法
查看>>
自己封装的cocos2dx中封装pomelo并导出给javascript使用
查看>>
javascript--iframe的JS方法,用法!contentWindow 、paren...
查看>>
徐飞:基于AngularJS的企业软件前端架构
查看>>