HDOJ 2054 A == B ?(精确大数相等)
2016-01-27 16:47
267 查看
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 2
2 2
3 3
4 3
Sample Output
NO
YES
YES
NO
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 2
2 2
3 3
4 3
Sample Output
NO
YES
YES
NO
import java.math.BigDecimal; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(sc.hasNext()){ BigDecimal A = sc.nextBigDecimal(); BigDecimal B = sc.nextBigDecimal(); if(A.compareTo(B)==0){ System.out.println("YES"); }else{ System.out.println("NO"); } } } }
相关文章推荐
- 数据库索引优缺点
- 用GDB调试程序
- 微信SDK导入报错 Undefined symbols for architecture i386:"operator delete[](void*)", referenced from:
- Oracle数据库SQL注入浅析与防护建议
- 小白讲讲Nine-Patch
- REST-WEB-2
- 基于Java代码实现判断春节、端午节、中秋节等法定节假日的方法
- linux实践-lvm
- Ajax请求跨域问题
- Xcode pch文件问题
- 什么是EPEL 及 Centos上安装EPEL
- 苹果IOS开发者账号总结
- Mac 登录界面多了一个其他账户删除
- googLeNet网络
- hdu 5363 Key Set【快速幂求余】
- VBA找不到progress bar的处理办法。
- Hadoop中的问题排查思路
- display: run-in
- display:table 表格布局
- NIC组合属性设置