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. ...
随机推荐
- jsp接收相同复合参数 request.getParameterValues()用法
在网站中往往需要用户选择复选框,此时需要创建多个复选框让用户进行选择: <head> <meta http-equiv="Content-Type" conten ...
- Jmeter Constant Throughput Timer 使用
Jmeter提供了一个非常有用的定时器,称为Constant Throughput Timer (常数吞吐量定时器),该定时器可以方便地控制给定的取样器发送请求的吞吐量. 右键点击fnng.cnblo ...
- 如何查看Linux的磁盘空间还有多少
无论是Linux还是unix,都提供了很多工具来查看磁盘空间的大小. 1. df命令,df命令,可以查看当前文件系统占用的空间的大小,以及剩余的大小,如下例子: Filesystem 1K-b ...
- [unity菜鸟] 修改发布成web后的logo
1. 原始效果 (tip:在4.x的书中有介绍) 2. 打开.html文件原始代码如下 <script type='text/javascript' src='jquery.min.js'&g ...
- ANDROID_MARS学习笔记_S01原始版_004_TableLayout
1.xml <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android ...
- 气死人不偿命,Q_OBJECT导致的C++报错,而且还看不明白(#ifdef没控制好,导致什么都不认识了)
为了代码可以同时适应VC++和MingW编译器,我改动了我的代码,变成: #ifdef _MSC_VER #pragma comment(lib, "crypt32.lib") / ...
- Layout Resource官方教程(2)用ViewStub引用的嵌入的layout可推迟加载
Loading Views On Demand THIS LESSON TEACHES YOU TO Define a ViewStub Load the ViewStub Layout YOU SH ...
- C++文件读写总结
在C++中如何实现文件的读写? 作者: infobillows 发表日期: 2007-04-03 21:33 点击数: 465 一.ASCII 输出 为了使用下面的方法, 你必须包含头文件<fs ...
- Java Memory Management(1)
Java Memory Management, with its built-in garbage collection, is one of the language’s finest achiev ...
- hadoop2.2原理:采样器
多输入路径-只采一个文件-(MultipleInputs+getsample(conf.getInputFormat) 之前弄采样器,以为已经结束了工作,结果现在又遇到了问题,因为我的输入有两个文件, ...