hdoj-2054-A == B ?

来源:互联网 发布:最坑爹的淘宝买家秀 编辑:程序博客网 时间:2024/05/05 08:50

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.math.BigDecimal;import java.util.Scanner;public class Main {    public static void main(String[] args) {        // TODO Auto-generated method stub        Scanner in =new Scanner (System.in);        while(in.hasNext())        {            BigDecimal a=in.nextBigDecimal();            BigDecimal b=in.nextBigDecimal();            int flag=a.compareTo(b);            //System.out.println(flag);            if(flag==0) System.out.println("YES");            else System.out.println("NO");        }    }}
0 0
原创粉丝点击