A == B ?
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 65535 Accepted Submission(s): 10246
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解题思路:使用JAVA库函数解决源代码:import java.util.Scanner; import java.math.BigDecimal;; public class Main { public static void main(String[]args){ Scanner scanner=new Scanner(System.in); BigDecimal a,b; while(scanner.hasNextBigDecimal()){ a=scanner.nextBigDecimal(); b=scanner.nextBigDecimal(); if(a.compareTo(b)==0) System.out.println("YES"); else System.out.println("NO"); } } }