Original title Link: http://acm.hunnu.edu.cn/online/?action=problem&type=show&id=11654&courseid=0
A large number of comparisons, decisive use of Java, but also pay attention to the details.
Note: The comparison can not use equals, if used 0.0 and 0.00 is not equal, a bit like HDU2054, the problem has a detailed explanation
http://blog.csdn.net/hurmishine/article/details/51382141
AC Code:
Import Java.math.bigdecimal;import Java.util.scanner;public class Main {public static void main (string[] args) {int kase= 0; Scanner sc = new Scanner (system.in), while (Sc.hasnext ()) {BigDecimal a = Sc.nextbigdecimal (); BigDecimal B = sc.nextbigdecimal (); BigDecimal zero = new BigDecimal (0); System.out.printf ("Case%d:", ++kase); if (A.compareto (b) ==0) {System.out.println ("Same");} else if (A.compareto (b) >0) {System.out.println ("bigger");} Else{system.out.println ("Smaller");}}}
is Hnnu 11654 big or small? "The 11th session of Hunan Province College students computer Program design Competition, Java large number comparison"