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

来源:互联网 发布:centos 7 xfce4 中文 编辑:程序博客网 时间:2024/05/17 08:03

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 22 23 34 3
 

Sample Output
NOYESYESNO
 

Author
8600 && xhd
 

Source
校庆杯Warm Up
 

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 stubScanner 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");}}}}


 

0 0