标签:style blog color java io ar for div 问题
为了快速解决高精度问题,总算是要来接触java了,算上这学期要开java的课了,好好学习吧!
拿来练手的是hdu的1002,高精度加法。
1 import java.util.*; 2 import java.math.*; 3 import java.io.*; 4 5 public class Main { 6 public static void main(String []args) { 7 8 Scanner in = new Scanner(System.in); 9 int n = in.nextInt(); 10 for(int cnt=1; cnt<=n; cnt++) 11 { 12 BigInteger a = in.nextBigInteger(); 13 BigInteger b = in.nextBigInteger(); 14 BigInteger c = a.add(b); 15 System.out.println("Case "+cnt+":"); 16 System.out.println(a + " + " + b + " = " + c); 17 if(cnt < n) 18 System.out.println(); 19 } 20 } 21 }
标签:style blog color java io ar for div 问题
原文地址:http://www.cnblogs.com/catdrivedragon/p/3945925.html