HDU1073:Online Judge
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.
START
#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的更多相关文章
- Gym 101102C---Bored Judge(区间最大值)
题目链接 http://codeforces.com/gym/101102/problem/C problem description Judge Bahosain was bored at ACM ...
- NOJ 1074 Hey Judge(DFS回溯)
Problem 1074: Hey Judge Time Limits: 1000 MS Memory Limits: 65536 KB 64-bit interger IO format: ...
- 【教程】如何正确的写一个Lemon/Cena的SPJ(special judge)
转自:http://www.cnblogs.com/chouti/p/5752819.html Special Judge:当正确的输出结果不唯一的时候需要的自定义校验器 首先有个框架 #includ ...
- 九度 Online Judge 之《剑指 Offer》一书相关题目解答
前段时间准备华为机试,正好之前看了一遍<剑指 Offer>,就在九度 Online Judge 上刷了书中的题目,使用的语言为 C++:只有3题没做,其他的都做了. 正如 Linus To ...
- UVa Online Judge 工具網站
UVa Online Judge 工具網站 UVa中译题uHuntAlgorithmist Lucky貓的ACM園地,Lucky貓的 ACM 中譯題目 Mirror UVa Online Judg ...
- [swustoj 1021] Submissions of online judge
Submissions of online judge(1021) 问题描述 An online judge is a system to test programs in programming c ...
- HDOJ/HDU 1073 Online Judge(字符串处理~)
Problem Description Ignatius is building an Online Judge, now he has worked out all the problems exc ...
- 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 ...
- UVA 489-- Hangman Judge(暴力串处理)
Hangman Judge In ``Hangman Judge,'' you are to write a program that judges a series of Hangman gam ...
随机推荐
- js行内式遇到的一些问题 DOM对象和jq对象转换的问题
这两天给后台页面做页面,我的工作比较简单,只需要写结构和样式就行了,写好之后,后端大哥用ajax重写页面加载数据,顺便给标签添加选中事件,做选中后变色的处理,但是却遇到一个问题,一直选不到触发事件这个 ...
- 正向代理vs.反向代理
正向代理 也就是传说中的代理,他的工作原理就像一个跳板,简单的说,我是一个用户,我访问不了某网站,但是我能访问一个代理服务器这个代理服务器呢,他能访问那个我不能访问的网站于是我先连上代 ...
- 明天学习一下验证码的匹配和thinkphp第十三章
333333333 js 冒泡排序 var arr=[17,19,5,90,3];window.onload=function(){// alert(arr[0]);var len=arr.lengt ...
- sqlplus登录Oracle时ORA-01017: invalid username/password; logon denied的错误
今天用scott用户登录Oracle数 据库时,竟然出现了ORA-01017: invalid username/password; logon denied错误,原以为是因为我的scott用户没有解 ...
- Storm常见问题处理
错误1:发布topologies到远程集群时,出现Nimbus host is not set异常.异常内容如下所示: [root@xop-dev-a bin]# ./storm jar /home/ ...
- 修改weblogic中StuckThreadMaxTime参数
your_domain->Environment ->Servers ->your_server->Configuration->Tuning->Stuck Thr ...
- MTK平台Android项目APK预置方案
项目开发中,通常需要向系统中预置一些APK,这里简单介绍一下MTK平台预置APK的方法. 需要预置的apk可以放置在目录:vendor/mediate/${Project}/artifacts/out ...
- c题 Registration system
Description A new e-mail service "Berlandesk" is going to be opened in Berland in the near ...
- 1010 Robot Motion
Problem Description A robot has been programmed to follow the instructions in its path. Instructions ...
- Git Bash 简单操作
在Windows下使用Git Bash,用的是Linux命令,常用几个文件操作命令如下: Windows命令 Linux命令 意义 cd e:\xxx cd /e/xxx 切换到xxx目录 cd pw ...