2054 A==B?
来源:互联网 发布:淘宝专享服务 编辑:程序博客网 时间:2024/06/02 01:01
A == B ?
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 59989 Accepted Submission(s): 9272
Problem Description
Give you two numbers A and B, if A is equal to B, you should print "YES", or print "NO".
Input
each test case contains two numbers A and B.
Output
for each case, if A is equal to B, you should print "YES", or print "NO".
Sample Input
1 22 23 34 3
Sample Output
NOYESYESNO
#include<iostream>#include<cstdio>#include<cstring>using namespace std;char a[15000],b[15000];int main(){ int a1,a2,b1,b2,i,j,tof; while(~scanf("%s%s",a,b)) { a1=b1=0; tof=1; a2=strlen(a)-1; b2=strlen(b)-1; while(a[a1]=='0') a1++; if(strchr(a,'.')) while(a[a2]=='0') a2--; if(a[a2]=='.') a2--; while(b[b1]=='0') b1++; if(strchr(b,'.')) while(b[b2]=='0') b2--; if(b[b2]=='.') b2--; if(a2-a1==b2-b1) { for(i=0;i<=a2-a1;i++) if(a[a1+i]!=b[b1+i]) { tof=0; break; } } else { printf("NO\n"); continue; } if(tof) printf("YES\n"); else printf("NO\n"); }}
0 0
- A^B = B^A
- A^B = B^A
- A^B = B^A
- A^B=B^A
- Python a,b=b,a+b
- a,b=b,a+b 与 a=b,b=a+b
- 2054 A == B
- A == B ? 2054
- 2054 A==B?
- a = b + (b = a) * 0;
- A *a=new B();
- A *a=new B();
- A *a=new B();
- 实现B=A+A’
- A a = new B();
- 交换a、b的值temp = a; a = b; b = temp;比a = a^b;b = a^b;a = a^b;快
- 函数交换两数 swap(a,b) a=a^b,b=a^b,a=a^b
- A == B ?
- 2053 Switch Game
- 任务调度器quatrz.触发机制表达式Cron
- 安装MYsql后,MYsql无法启动
- DB Browser的使用
- 可靠UDP传输的实现
- 2054 A==B?
- leedcode做题总结,题目Binary Tree Postorder Traversal-------- 2013/11/07
- linux loop设备
- 线程中使用ADO 后入输入法冲突解决办法....
- Java检测无用代码之UCDetector
- java多线程Future和Callable类的解释与使用
- Servlet 中上传文件,前4个文件正确上传,后面文件上传时报目录访问拒绝
- 火车头的汽车好样的
- LeetCode OJ - Remove Element