问题描述:

HD-ACM算法专攻系列(12)——Integer Inquiry

HD-ACM算法专攻系列(12)——Integer Inquiry

 

 

源码:

 

import java.math.BigInteger;
import java.util.*;

public class Main
{
		//主函数
        public static void main(String[] args)
        {
            int n;
			BigInteger a, result, zero = BigInteger.valueOf(0);
			Scanner cin = new Scanner(System.in);
			n = cin.nextInt();
			for(int i = 0; i < n; i++)
			{
				if(i > 0)System.out.println();
				result = BigInteger.valueOf(0);
				while(true)
				{
					a = cin.nextBigInteger();
					if(a.equals(zero))break;
					result = result.add(a);
				}
				System.out.println(result);
				
			}
		}
}

  

相关文章:

  • 2021-12-25
  • 2021-06-12
  • 2021-09-10
  • 2021-10-25
  • 2021-06-17
  • 2021-12-28
  • 2021-12-28
  • 2021-07-03
猜你喜欢
  • 2021-11-14
  • 2021-11-15
  • 2021-12-30
  • 2022-01-17
  • 2021-06-20
  • 2022-01-27
  • 2021-10-29
相关资源
相似解决方案