Integer Inquiry_hdu_1047(大数).java
Integer Inquiry
Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
 Total Submission(s): 9376    Accepted Submission(s): 2406
 
``This supercomputer is great,'' remarked Chip. ``I only wish Timothy were here to see these results.'' (Chip moved to a new apartment, once one became available on the third floor of the Lemon Sky apartments on Third Street.)
The final input line will contain a single zero on a line by itself.
  
 
 
This problem contains multiple test cases!
The first line of a multiple input is an integer N, then a blank line followed by N input blocks. Each input block is in the format indicated in the problem description. There is a blank line between input blocks.
The output format consists of N output blocks. There is a blank line between output blocks.
  
 
 
123456789012345678901234567890
123456789012345678901234567890
123456789012345678901234567890
0
import java.math.BigInteger;
import java.util.Scanner; public class Main {//没咋看懂是怎么输入的
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
while(input.hasNext()){
int n=input.nextInt();
while(n-->0){
BigInteger sum=BigInteger.valueOf(0);
BigInteger a;
while(!(a=input.nextBigInteger()).equals(BigInteger.valueOf(0))){
sum=sum.add(a);
}
System.out.println(sum);
if(n>0)
System.out.println();
}
}
}
}
Integer Inquiry_hdu_1047(大数).java的更多相关文章
- Cannot convert 0 of type class java.lang.Integer to class java.lang.Boolean
		org.apache.catalina.core.ApplicationDispatcher invoke SEVERE: Servlet.service() for servlet jsp thre ... 
- Provided id of the wrong type for class pojo.Books. Expected: class java.lang.Integer, got class java.lang.Long
		log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment). log4j:WARN Please ... 
- HDU 1715 大数java
		大菲波数 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submis ... 
- POJ 1503 Integer Inquiry(大数相加,java)
		题目 我要开始练习一些java的简单编程了^v^ import java.io.*; import java.util.*; import java.math.*; public class Main ... 
- hdu acm-1047 Integer Inquiry(大数相加)
		Integer Inquiry Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)T ... 
- HDU1134/HDU1133 递推 大数 java
		Game of Connections Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Othe ... 
- HDU1063 大数 java
		Exponentiation Time Limit: 2000/500 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Tot ... 
- How Many Fibs_hdu_1316(大数).java
		How Many Fibs? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) T ... 
- 大数java(pow)
		Problems involving the computation of exact values of very large magnitude and precision are common. ... 
随机推荐
- IgnoreRoute——注册路由
			routes.IgnoreRoute("home/about"); 这句话,当Route遇到Home/About的Url时,这段URL将被忽略. 效果图 需要注意的是这里route ... 
- sql 复杂自动编号错误批量修改方案
			[一篮饭特稀原创,转载请注明出自http://www.cnblogs.com/wanghafan/p/5133953.html] 前提:自动编号为18位,前4位是年份,中间10位是XXXX,最后四位 ... 
- iOS开发UI篇—UITabBarController生命周期(使用storyoard搭建)
			iOS开发UI篇—UITabBarController生命周期(使用storyoard搭建) 一.UITabBarController在storyoard中得搭建 1.新建一个项目,把storyb ... 
- 李洪强漫谈iOS开发[C语言-016]-变量的作用域
- leetcode面试准备:Sliding Window Maximum
			leetcode面试准备:Sliding Window Maximum 1 题目 Given an array nums, there is a sliding window of size k wh ... 
- C++11 中的线程、锁和条件变量
			转自:http://blog.jobbole.com/44409/ 线程 类std::thread代表一个可执行线程,使用时必须包含头文件<thread>.std::thread可以和普通 ... 
- SSH框架应用中常用Jar包用途介绍
			struts2需要的几个jar包:1)xwork-core-2.1.62)struts2-core-2.1.83)ognl-2.7.34)freemarker-2.3.155)commons-io-1 ... 
- cogs_14_搭配飞行员_(二分图匹配+最大流,网络流24题#01)
			描述 http://cojs.tk/cogs/problem/problem.php?pid=14 有一些正飞行员和副飞行员,给出每个正飞行员可以和哪些副飞行员一起飞.一架飞机上必须一正一副,求最多多 ... 
- 转自 z55250825 的几篇关于FFT的博文(三)
			题目大意:给出n个数qi,定义 Fj为 令 Ei=Fi/qi,求Ei. 其实这道题就是看到有FFT模板才觉得有必要学一下的... 所以实际上就是已经知道题解了... = ... 
- jQuery里面的datepicker日期控件默认是显示英文的,如何显示中文或其他语言呢?
			jQuery里面的datepicker日期控件默认是显示英文的,如何让他显示中文或其他呢? [官方的写法]: (1)引入JS文件: <script type="text/javascr ... 
