hdu 1073 字符串处理
题意:给一系列的输出和标准答案,比较二者是AC,PE或WA
字符串处理还是比较薄弱,目前没什么时间搞字符串专题,所以遇到一题就努力搞懂
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<queue>
#include<map>
using namespace std;
#define MOD 1000000007
const double eps=1e-;
#define cl(a) memset(a,0,sizeof(a))
#define ts printf("*****\n");
const int MAXN=;
char a1[MAXN],a2[MAXN],b1[MAXN],b2[MAXN];
int n,m,tt;
char temp[MAXN];
void in(char a[],char b[])
{
gets(temp);
while(strcmp(temp,"START")!=) gets(temp); //START之前的都去掉
while(gets(temp))
{
if(strcmp(temp,"END")==) break;
if(strlen(temp)!=) strcat(a,temp); //读入的不为换行符
strcat(a,"\n");
}
int t=;
for(int i=;i<strlen(a);i++)
{
if(a[i]!=' '&&a[i]!='\n'&&a[i]!='\t') //\t要加,因为题目中有要求,汗
{
b[t++]=a[i];
}
}
b[t]='\0'; //注意这个一定要加,否则没办法比较
}
int main()
{
int i,j,k;
#ifndef ONLINE_JUDGE
freopen("1.in","r",stdin);
#endif
scanf("%d",&tt);
while(tt--)
{
a1[]='\0';
a2[]='\0';
in(a1,b1);
in(a2,b2);
if(strcmp(a1,a2)==) printf("Accepted\n"); //未被删除格式前都相同,说明完全相同
else if(strcmp(b1,b2)==) printf("Presentation Error\n");
else printf("Wrong Answer\n");
}
}
hdu 1073 字符串处理的更多相关文章
- 单词数 HDU 2072 字符串输入控制
单词数 HDU 2072 字符串输入控制 题意 lily的好朋友xiaoou333最近很空,他想了一件没有什么意义的事情,就是统计一篇文章里不同单词的总数.下面你的任务是帮助xiaoou333解决这个 ...
- HDOJ/HDU 1073 Online Judge(字符串处理~)
Problem Description Ignatius is building an Online Judge, now he has worked out all the problems exc ...
- HDU 1073 Online Judge (字符串处理)
题目链接 Problem Description Ignatius is building an Online Judge, now he has worked out all the problem ...
- HDU 1073 Online Judge(字符串)
Online Judge Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tot ...
- HDU 1073
http://acm.hdu.edu.cn/showproblem.php?pid=1073 模拟oj判题 随便搞,开始字符串读入的细节地方没处理好,wa了好久 #include <iostre ...
- 解题报告:hdu 1073 Online Judge
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1073 Problem Description Ignatius is building an Onli ...
- hdu 4821 字符串hash+map判重 String (长春市赛区I题)
http://acm.hdu.edu.cn/showproblem.php?pid=4821 昨晚卡了非常久,開始TLE,然后优化了之后,由于几个地方变量写混.一直狂WA.搞得我昨晚都失眠了,,. 这 ...
- hdu 1880 字符串hash
/*普通的hsah 由于元素太多 空间很小..hash碰撞很厉害.30分*/ #include<iostream> #include<cstdio> #include<c ...
- HDU 1880 字符串hash 入门题
Problem Description 哈利波特在魔法学校的必修课之一就是学习魔咒.据说魔法世界有100000种不同的魔咒,哈利很难全部记住,但是为了对抗强敌,他必须在危急时刻能够调用任何一个需要的魔 ...
随机推荐
- python---django中模板渲染(csrf令牌使用,自定义模板函数)
使用终端,可以更方便的去实验,但是没有提示信息: 在项目目录下: D:\MyPython\day23\HelloWorld>python manage.py shell 开始实验: >&g ...
- Solr记录-solr基础内容
Solr架构(体系结构) 在本章中,我们将讨论Apache Solr的架构. 下图显示了Apache Solr的体系结构的框图. Solr架构 - 构件块以下是Apache Solr的主要构建块(组件 ...
- Codeforces #55D-Beautiful numbers (数位dp)
D. Beautiful numbers time limit per test 4 seconds memory limit per test 256 megabytes input standar ...
- [转载]DOMContentLoaded与interactive
http://www.cnblogs.com/muxrwc/archive/2011/01/13/1934379.html ie中inline script执行时竟然第一次进入页面,doc.ready ...
- argunlar 1.0.1 【数据绑定】
<!DOCTYPE html><html lang="en" ng-app><head> <meta charset="U ...
- div中添加滚动条
<div style="position:absolute; height:400px; overflow:auto"></div>div 设置滚动条显示: ...
- Google Protocol Buffer的安装与.proto文件的定义(转)
转自(https://www.cnblogs.com/yinheyi/p/6080244.html) 什么是protocol Buffer呢? Google Protocol Buffer( 简称 P ...
- js array数组检测方式
typeof var arr = [1,2,3]; console.log(typeof arr);//'object' 数组的本质是一种特殊的对象,所以返回'object'.typeof运算符只能用 ...
- sonarLint--强大的代码审查工具(插件)
idea也有的一个插件 贴上一个eclipse的sonarlint用法 http://blog.csdn.net/limm33/article/details/51166840 不过听说从2015年1 ...
- knnMatch
先马克下,回头再看:http://blog.csdn.net/zkl99999/article/details/47950425 http://blog.csdn.net/yangtrees/arti ...