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用C++写太麻烦了,需要考虑各种情况,前导零,后导零,正负数,整数小数。。。直接用java水过。。。import java.io.*; import java.math.*; import java.util.*; public class Main { public static void main(String[] args) { Scanner cin = new Scanner(System.in); BigDecimal x, y; while(cin.hasNextBigDecimal()){ x = cin.nextBigDecimal().stripTrailingZeros(); y = cin.nextBigDecimal().stripTrailingZeros(); if(x.equals(y)) System.out.println("YES"); else System.out.println("NO"); } } }