HDOJ 1047 Integer Inquiry
JAVA睑板....
Integer Inquiry
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 12042 Accepted Submission(s): 3037
``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.
import java.util.*;
import java.math.*;public class Main
{public static void main(String[] args){Scanner cin= new Scanner(System.in);int n=cin.nextInt();boolean flag=false;while(n-->0){if(flag==false) flag=true;else System.out.println("");BigInteger ans=BigInteger.ZERO;while(cin.hasNextBigInteger()){BigInteger m=cin.nextBigInteger();if(m.equals(BigInteger.ZERO))break;ans=ans.add(m);}System.out.println(ans);}}
}
版权声明:本文博客原创文章,博客,未经同意,不得转载。
HDOJ 1047 Integer Inquiry相关推荐
- hdu 1047 Integer Inquiry
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=1047 Integer Inquiry Description One of the first use ...
- HDU 1047 Integer Inquiry( 高精度加法水 )
链接:传送门 思路:高精度水题 /*************************************************************************> File ...
- Poj 1503 Integer Inquiry
1.链接地址: http://poj.org/problem?id=1503 2.题目: Integer Inquiry Time Limit: 1000MS Memory Limit: 1000 ...
- ZOJ 1292 Integer Inquiry
https://zoj.pintia.cn/problem-sets/91827364500/problems/91827364791 题意:先输入一个数 表示测试样例的个数,接着输入几个数(可以不 ...
- Integer Inquiry
java大数加法 import java.io.*; import java.math.*; import java.util.*;public class Main {public static v ...
- 杭电OJ分类题目(1)
原题出处:HDOJ Problem Index by Type,http://acm.hdu.edu.cn/typeclass.php 杭电OJ分类题目(1) HDU Introduction HDU ...
- Java Java Java
学下java 的大数该怎么用>< hdu 1023 Train Problem II 求 卡特兰 数 诶...不记得卡特兰数的我眼泪掉下来 第一次用 java 大数 有点激动...> ...
- POJ题目分类(按初级\中级\高级等分类,有助于大家根据个人情况学习)
本文来自:http://www.cppblog.com/snowshine09/archive/2011/08/02/152272.spx 多版本的POJ分类 流传最广的一种分类: 初期: 一.基本算 ...
- 题目梳理(一)(2019.07.06~2019.07.20)
一.字典树类型 A HihoCoder1014 Trie树(已做) 题目链接 https://hihocoder.com/problemset/problem/1014 B HDU12 ...
最新文章
- 【TUP第11期】腾讯黄朝兴:浅谈客户端架构
- Apache服务器部署ASP.NET网站
- 关于Servlet和异步Servlet
- fatal: Could not read from remote repository.的解决办法
- 最短哈密尔顿圈matlab解法_复杂制造过程最优哈密尔顿圈算法的MATLAB仿真与分析.doc...
- cam350 不能打开光绘文件_CAM350使用教程-复制Gerber层
- 金三银四Java面试的一些感受,实战篇
- [湖南集训] 谈笑风生
- phpstorm 新加入项目的文件--全局搜索不到 ctrl + shift + R
- 钉钉日志范文100篇_钉钉工作日记(模板一)
- 英语知识系列:单词中元音字母发音规律
- VINS-MONO边缘化策略
- Linux centOS系统备份还原(dd+rsync方式)
- 《数字图像处理》冈萨雷斯版 读书笔记(二)
- Typora自定义样式--你值得拥有自己的styles
- jQuery取消checkbox选中状态
- unity打包安卓(anroid)APK及安卓环境设置
- org.apache.poi.ss.usermodel.Cell.getCellType()Lorg/apache/poi/ss/usermodel/CellType(百分比解决你问题)
- Docker容器学习笔记一
- MySQL数据库使用小皮系统(phpstudy)的安装及配置流程
热门文章
- linux默认的https端口,如何在Ubuntu 18.04 Bionic Beaver Linux上拒绝除HTTP端口80和HTTPS端口443之外的所有传入端口...
- 简单的python画图代码_python opencv如何实现简易画图板 python opencv实现简易画图板代码...
- android是语言吗,android – 内容描述应该是多种语言吗?
- 虚拟机随服务器启动,VMware Server中虚拟机随宿主机自动启动
- 怎么将翼型导入catia_CATIA导入翼型出现了问题,翼型是在网上找的。说是样条线运算有问题 - 机械 - 小木虫 - 学术 科研 互动社区...
- java socket 线程池_java socket编程的一个例子(线程池)
- 360 php offer,审批终于通过了,从面试到拿到奇虎360的offer已经失…
- Windows下设置自动关机的命令指示符
- 不妨问问自己,学习C语言是为了什么?
- 中国剩余定理证明过程