标签:
1 2 2 2 3 3 4 3
NO YES YES NO
java大数真是开挂般的存在啊
如果用c做的话 不要忘记00005=5,0.5000=0.5
import java.math.BigDecimal; import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sca=new Scanner(System.in); while(sca.hasNext()){ BigDecimal a=sca.nextBigDecimal(); BigDecimal b=sca.nextBigDecimal(); String num1=a.stripTrailingZeros().toString(); String num2=b.stripTrailingZeros().toString(); if(num1.equals(num2)){ System.out.println("YES"); } else{ System.out.println("NO"); } } sca.close(); } }
标签:
原文地址:http://blog.csdn.net/su20145104009/article/details/52206305