您的位置:首页 > 编程语言 > Java开发

hdu 2054 A == B ? (java大数)

2014-10-11 14:27 495 查看


A == B ?

Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)

Total Submission(s): 62507 Accepted Submission(s): 9807



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



注意a,b用BIgDecimal

import java.util.*;
import java.math.*;

public class Main
{
	public static void main(String args[])
	{
		Scanner cin = new Scanner(System.in);
		BigDecimal a,b;
		while(cin.hasNextBigDecimal())
		{
			a=cin.nextBigDecimal();
			b=cin.nextBigDecimal();
			if(a.compareTo(b)==0)
				System.out.println("YES");
			else
				System.out.println("NO");
		}
	}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: