HDU 1073 Online Judge water~~~
来源:互联网 发布:魔幻手机特效软件下载 编辑:程序博客网 时间:2024/05/20 05:22
题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=1073
没事刷刷水题~~~
关键是控制好每个字符。
AC代码:
#include <iostream>#include <cstdio>#include <cstdlib>#include <cmath>#include <cstring>#include <string>#include <vector>#include <list>#include <deque>#include <queue>#include <iterator>#include <stack>#include <map>#include <set>#include <algorithm>#include <cctype>using namespace std;typedef long long LL;const int N=5222;const LL II=1000000007;const double PI=3.141592653;char s1[100][N],s2[100][N];int i1,i2;int xiaohao(){ int i,j; if(i1==i2) { int flag=0; for(i=0;i<i1;i++) if(strcmp(s1[i],s2[i])!=0) { flag=1;break; } if(flag==0) return 0; } string x1="",x2=""; for(i=0;i<i1;i++) { int len=strlen(s1[i]); for(j=0;j<len;j++) if(s1[i][j]!=' '&&s1[i][j]!='\t'&&s1[i][j]!='\n') x1+=s1[i][j]; } for(i=0;i<i2;i++) { int len=strlen(s2[i]); for(j=0;j<len;j++) if(s2[i][j]!=' '&&s2[i][j]!='\t'&&s2[i][j]!='\n') x2+=s2[i][j]; } //cout<<x1<<" "<<x2<<endl; if(x1==x2) return 1; return 2;}int main(){ int i,ca=1,T; cin>>T; getchar();//这个地方一定不能掉,开始我就掉了 while(T--) { i1=0,i2=0; gets(s1[0]); while(gets(s1[i1])&&strcmp(s1[i1],"END")!=0) { i1++; } gets(s2[0]); while(gets(s2[i2])&&strcmp(s2[i2],"END")!=0) { i2++; } int k=xiaohao(); if(k==0) printf("Accepted\n"); else if(k==2) printf("Wrong Answer\n"); else if(k==1) printf("Presentation Error\n"); } return 0;}
- HDU 1073 Online Judge water~~~
- hdu 1073 Online Judge
- HDU 1073 Online Judge
- HDU 1073 Online Judge
- HDU 1073 Online Judge
- hdu 1073 Online Judge
- HDU 1073 Online Judge
- hdu 1073 Online Judge
- hdu 1073 Online Judge
- hdu 1073 Online Judge
- hdu 1073 Online Judge
- hdu 1073 Online Judge
- hdu 1073 Online Judge
- HDU 1073 Online Judge
- HDU 1073 Online Judge
- hdu 1073 Online Judge
- HDU 1073 Online Judge
- hdu 1073 Online Judge
- "棱镜门事件"的思考:黑客是什么,如何成为黑客?[更新:2015-05-09]
- SQL Server 2014 BI新特性(二)结合Data Explorer和GeoFlow进行数据分析
- 把extjs4.2 desktop 窗口最大化动画效果移植到extjs4.1 中
- python game练习5
- 腾讯的创始人们
- HDU 1073 Online Judge water~~~
- IBM笔记本音量调大后出现刺耳的声音这是什么故障
- sql exists 的妙用
- 在VMWare Workstation8.0上使用ubuntu11安装和配置Hadoop群集环境03_hadoop的安装
- E - A very hard mathematic problem题解
- 寓言故事:羊、狼、狮子(转帖,时寒冰博客网友留言)
- Objective-c中的protocol
- linux内核升级
- SharePoint 2010 类似人人网站内信功能实施