题意:输入整数a,b,c,d,输出他们的和
a, b, c, d ≤ 2^62
思路:ANS可能会炸long long
队友直接上Java
1 import java.math.BigInteger; 2 import java.util.Arrays; 3 import java.util.Scanner; 4 5 6 public class Main { 7 public static void main(String[] args){ 8 int t; 9 BigInteger a,b,c,d,ans; 10 Scanner sc = new Scanner(System.in); 11 t = sc.nextInt(); 12 for(int i = 1; i <= t; ++i){ 13 a = sc.nextBigInteger(); 14 b = sc.nextBigInteger(); 15 c = sc.nextBigInteger(); 16 d = sc.nextBigInteger(); 17 ans = a.add(b.add(c.add(d))); 18 System.out.println(ans); 19 } 20 } 21 }