HDU2054
2018-04-11 14:00
225 查看
本文章仅用于笔记。部分知识点来源于网络,授权请联系作者(1091879478@qq.com)。
题目
A == B ? HDU - 2054
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
代码
题目
A == B ? HDU - 2054
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
代码
//AC版 public static void main(String[] args) { Scanner s = new Scanner(System.in); while (s.hasNextBigDecimal()) { BigDecimal a=s.nextBigDecimal(); BigDecimal b=s.nextBigDecimal(); if (a.compareTo(b)==0) System.out.println("YES"); else System.out.println("NO"); } } //WA版 public static void main(String[] args) { Scanner s = new Scanner(System.in); while (s.hasNext()) { String a=s.next(); String b=s.next(); if (a.equals(b)) System.out.println("YES"); else System.out.println("NO"); } } //WA版中 01 1 输出NO //AC版中 01 1 输出YES //需要的是数字而不是字符串 //用String的equals不够规范
相关文章推荐
- hdu2054
- hdu2054A == B ?
- 大数——大数判等(hdu2054)
- HDU_Steps9.1 杂题 HDU2054 HDU1789 HDU2159 HDU1401 HDU2818 HDU3465 HDU2433 HDU3524
- HDU2054_A == B ?【模拟题】【大数】【水题】
- hdu2054 判断俩数是否相等
- HDU2054 A == B ? 模拟题
- HDU2054---A == B ?
- Hdu2054:A==B?大数高精度算法
- HDU2054
- hdu2054
- HDU2054---A==B?
- hdu2054 A == B ?
- HDU2054_A == B ?【模拟题】【大数】【水的问题】
- hdu2054(坑爹题)
- HDU2054 Hexadecimal View 字符串处理
- 水仙题-hdu2054
- hdu2054 看了许多大佬的想法 就是找小数点 比较两个字符串的函数
- HDU2054:A == B ?
- HDU2054--A==B?