您的位置:首页 > 其它

hdu1002

2015-08-12 21:50 281 查看
水题我也不多说什么了直接附上代码,用大树来解决

import java.math.BigInteger;

import java.util.Scanner;

public class p1002 {

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

int n = sc.nextInt();

for (int i = 1; i <= n; i++) {
BigInteger a = sc.nextBigInteger();// 用大树加法
BigInteger b = sc.nextBigInteger();
System.out.println("Case " + i + ":");
if (i < n) {
System.out.println(a + "+" + b + "=" + a.add(b));
System.out.println();
} else {
System.out.println(a + "+" + b + "=" + a.add(b));
}
}

}


}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: