标签:
1 import java.math.*; 2 import java.util.Scanner; 3 4 5 public class Main{ 6 public static void main(String[] args){ 7 BigInteger a,b; 8 int n; 9 BigInteger ans; 10 Scanner cin = new Scanner(System.in); 11 n=cin.nextInt(); 12 a=cin.nextBigInteger(); 13 b=cin.nextBigInteger(); 14 ans=a.add(b); 15 System.out.println("Case 1:"); 16 System.out.println(a+" + "+b+" = "+ans); 17 for(int i=2;i<=n;i++) 18 { 19 a=cin.nextBigInteger(); 20 b=cin.nextBigInteger(); 21 ans=a.add(b); 22 System.out.println(); 23 System.out.println("Case "+i+":"); 24 System.out.println(a+" + "+b+" = "+ans); 25 } 26 } 27 }
标签:
原文地址:http://www.cnblogs.com/wsruning/p/4702996.html