A == B ?
来源:互联网 发布:淘宝上的中药能买吗 编辑:程序博客网 时间:2024/06/01 20:50
A == B ?
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 64960 Accepted Submission(s): 10164
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;#define LEN 100000int main() { char a[LEN]; char b[LEN]; int lena, lenb, len, i; while(cin >> a >> b) { lena = 0; lenb = 0; len = strlen(a); len--; for(i = 0; i <= len; i++) { if(a[i] == '.') { lena = i; break; } } while(a[len] == '0' && len > lena && lena != 0) { a[len] = '\0'; len--; } if(a[len] == '.') { a[len] = '\0'; } len = strlen(b); len--; for(i = 0; i <= len; i++) { if(b[i] == '.') { lenb = i; break; } } while(b[len] == '0' && len > lenb && lenb != 0) { b[len] = '\0'; len--; } if(b[len] == '.') { b[len] = '\0'; } if(strcmp(a, b) == 0) { cout << "YES" << endl; } else { cout << "NO" << endl; } } return 0;}
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
- 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 ?
- A == B ?
- A==B?
- A == B ?
- mysql 锁
- 最长递增子序列
- 用户界面View之Chronometer
- win7 64位系统怎么使用debug命令
- Python "Attribute" Definition
- A == B ?
- addActionListener(this)
- Ubuntu 15.04 开发计划确定 最终发布日期2015年4月23日
- 删除linux系统中的eth0.bak与多余的网卡
- windows server 2008 r2 下的VMware虚拟机共享主机上网
- Linux ramdisk启动
- Gradle Android 工程开启 multiDex
- socket.io实践篇(1)
- 符号表之List 实现