码迷,mamicode.com
首页 > 编程语言 > 详细

HDU-2054-A == B?(Java大数BigDecimal)

时间:2015-05-03 13:27:52      阅读:161      评论:0      收藏:0      [点我收藏+]

标签:hdu   java   acm   大数   bigdecimal   

A == B ?

Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 72556    Accepted Submission(s): 11427


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
 

Author
8600 && xhd
 

Source
 

Recommend
linle   |   We have carefully selected several similar problems for you:  2057 2050 1096 1091 2074 


比起c选手,只有在做大数的时候,有一种自然而然的优越感技术分享


import java.io.*;
import java.math.BigDecimal;
import java.util.*;

public class Main
{

	public static void main(String[] args)
	{
		// TODO Auto-generated method stub
		Scanner input = new Scanner(System.in);
		while(input.hasNext())
		{
			BigDecimal a = input.nextBigDecimal();
			BigDecimal b = input.nextBigDecimal();
			if(a.compareTo(b)!=0)
			{
				System.out.println("NO");
			}
			else
			{
				System.out.println("YES");
			}
		}
	}

}


 

HDU-2054-A == B?(Java大数BigDecimal)

标签:hdu   java   acm   大数   bigdecimal   

原文地址:http://blog.csdn.net/qq_16542775/article/details/45457439

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!