a==b? java

版权声明: https://blog.csdn.net/nucleare/article/details/82988505

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
import java.math.BigDecimal;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		BigDecimal a, b;
		Scanner cin = new Scanner(System.in);
		while (cin.hasNext()) {
			a = cin.nextBigDecimal();
			b = cin.nextBigDecimal();
			if (a.compareTo(b) == 0) System.out.println("YES");
			else System.out.println("NO");
		}
	}

}

猜你喜欢

转载自blog.csdn.net/nucleare/article/details/82988505