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. ...
随机推荐
- Hansight
http://www.hansight.com/scenarios.html#account
- Android 设置thumb图片大小
xml: android:thumb="@drawable/seekbar_thumb" seekbar_thumb.xml: <?xml version="1.0 ...
- 通过Hibernate将数据库在myeclipse中逆向生成
1.首先准备好数据库. 2.在MyEclipse的右上角切换透视图,切换到MyEclipse Database Explorer 3.在最左边点击右键,选择New(也就是新建一个数据库连接),然后编写 ...
- jquery data方法
jquery.data()文档:http://api.jquery.com/jQuery.data/ html5有个data-*属性,跟这个功能一样. Note: This is a low-leve ...
- tlplayer for ios V1.1.2加密测试版本(修复1.1.1版本 for ios7播放闪退问题)
此版本主要修复了ios7播放列表导致的程序闪退问题,方便大家测试加密与非加密视频. 此为tlplayer for ios版本,可以播放加密视频与非加密视频. 加密视频下载地址:http://blog. ...
- 个人所得税计算器2016 by Jacksile
个人所得税计算器2016 // (83500+i)) { var to=(all*45/100-13505).toFixed(2); document.getElementById("int ...
- Webform——购物车
购物车主要实现的功能: ①在主页面可以将所有商品显示出来,包括价格,库存. ②点击购买可以累加产品,如果是同一种产品,只会累加每种产品的数量. ③查看购物车,可以查看明细,包括所购物品的名称,价格,数 ...
- c语言时间库函数#include<time.h>
日期与时间函数<time.h> 头文件<time.h>中说明了一些用于处理日期和时间的类型和函数.其中的一部分函数用于处理当地时间,因为时区等原因,当地时间与日历时间可能不相同 ...
- 【转】VC中获取文件的相对路径和绝对路径
原文网址:http://www.360doc.com/content/13/0703/16/3402399_297386231.shtml
- wpa_supplicant 与iwpriv工具配置WIFI的命令
=====================================================hostapd 配置命令=================================== ...