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 ...
随机推荐
- c++中小项堆声明和使用【转】
c++默认是大顶堆,小顶堆有两种声明方法: 1.对于基本类型直接用 priority_queue<int, vector<int>, greater<int> >p ...
- 第二次讨论——响应式设计、布局技巧、css性能优化、css预处理
第二次讨论 [响应式设计] 集中创建页面的图片排版大小,可以智能地根据用户行为以及使用的设备环境(系统平台.屏幕尺寸.屏幕定向等)进行相对应的布局. 响应式布局: meta标签的实用:设置布局宽度等于 ...
- Linux 相关的error处理
1 dpkg: error: duplicate file trigger interest for filename Notice the first and last lines of /var ...
- wxpython 安装教程
wxpython在windows 上的安装,需要在wxpython官网上下载对应的版本:Python分为32和64位系统不是系统的32位和64位 所以可以先在IDE 下输入Python看下当前是32还 ...
- On the first day here
记录一下到这里的第一天 简单的自我介绍一下: 姓名: 郑超杰 昵称: 蝴蝶 English Nickname: developerbfl 技能: OC H5 Swift ...
- 安卓Activity、service是否处于同一进程
Activity与Service是否处于同一进程? 1)默认情况下(不写android:process的时候),此时同一个应用程序的所有组建位于同一进程里,Activity与service也处于同 ...
- 2016年团体程序设计天梯赛-决赛 L1-5. 是不是太胖了(5)
据说一个人的标准体重应该是其身高(单位:厘米)减去100.再乘以0.9所得到的公斤数.已知市斤是公斤的两倍.现给定某人身高,请你计算其标准体重应该是多少?(顺便也悄悄给自己算一下吧……) 输入格式: ...
- setsockopt、getsockopt详细介绍(转)
本文只讲解socket编程中的 setsockopt.getsockopt两个函数.关于其它函数的介绍可以参考下面链接:http://blog.sina.com.cn/s/blog_a459dcf50 ...
- Ambari删除服务
ambari-cassandra-service上面推荐的方法: curl -u admin:$PASSWORD -i -H 'X-Requested-By: ambari' -X PUT -d '{ ...
- c++的复制构造函数
在C++中,下面三种对象需要调用拷贝构造函数(有时也称“复制构造函数”): 1) 一个对象作为函数参数,以值传递的方式传入函数体: 2) 一个对象作为函数返回值,以值传递的方式从函数返回: 3) 一个 ...