A == B ?
来源:互联网 发布:网络词语老干部啥意思 编辑:程序博客网 时间:2024/05/01 22:52
DescriptionGive 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 2
2 2
3 3
4 3
2 2
3 3
4 3
Sample Output
NO
YES
YES
NO
YES
YES
NO
#include <iostream>//2054 A==B#include <string>using namespace std;void change(string &str){ if( strchr(str.c_str() , '.' ) ) { int last=str.length(); while(str[--last]=='0') str.erase(last,1) ; //删除后置0 if( str[last]=='.' ) str.erase(last,1) ; //若全为0,删除小数点 } while(str[0]=='0')//前置0的处理 { if( str.length()!=1 ) str.erase(0,1);//若全为0,则保存一个0 else return; }}int main(){ string a,b; while(cin>>a>>b) { change(a); change(b); if(a.compare(b)==0) cout<<"YES"<<endl; else cout<<"NO"<<endl; }}
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 ?
- String Compression - UVa 1351 dp+hash
- mysql安装InnoDB存储引擎
- poj 2337-Catenyms
- 1.0 机器学习所需的数学
- RakNet学习(48) -- Replica Manager 3
- A == B ?
- 统计文本单词的个数
- 【opencv】图像截取、合并、反色、canny边缘、二值化
- 时间复杂度
- 简单的文档转码转换工具包
- 静静的下午
- Java中ClassPath设置
- Oracle ADF 开发必读
- RelativeLayout