POJ 1503 Integer Inquiry【大数相加 java】
来源:互联网 发布:testflight是什么软件 编辑:程序博客网 时间:2024/06/01 07:48
Integer Inquiry
Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 26642 Accepted: 10325
Description
One of the first users of BIT's new supercomputer was Chip Diller. He extended his exploration of powers of 3 to go from 0 to 333 and he explored taking various sums of those numbers.
``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.)
``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.)
Input
The input will consist of at most 100 lines of text, each of which contains a single VeryLongInteger. Each VeryLongInteger will be 100 or fewer characters in length, and will only contain digits (no VeryLongInteger will be negative).
The final input line will contain a single zero on a line by itself.
The final input line will contain a single zero on a line by itself.
Output
Your program should output the sum of the VeryLongIntegers given in the input.
Sample Input
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678900
Sample Output
370370367037037036703703703670
Source
East Central North America 1996
1503Accepted3328K688MSJava461B2013-05-10 02:23:25
import java.util.Scanner;import java.io.*;import java.math.*;public class Main {public static void main(String args[]) {Scanner cin = new Scanner(new BufferedInputStream(System.in));BigInteger a;BigInteger b = new BigInteger("0");BigInteger c = new BigInteger("0");while(cin.hasNextBigInteger()) {a = cin.nextBigInteger();if(a.compareTo(c) == 0) break;b = b.add(a); }System.out.println(b);}}
- POJ 1503 Integer Inquiry【大数相加 java】
- POJ 1503 Integer Inquiry(大数相加)
- POJ 1503 Integer Inquiry 简单大数相加
- poj 1503 Integer Inquiry(多个大数相加)
- POJ-1503 Integer Inquiry-多个大数相加
- Integer Inquiry 大数相加
- Integer Inquiry(大数相加)
- Integer Inquiry 大数相加
- PKU-1503 Integer Inquiry(模拟大数相加)
- POJ--1503:Integer Inquiry 大数加法
- POJ 1503 Integer Inquiry JAVA .
- zoj_1292 Integer Inquiry(大数相加)
- HDU-1047 Integer Inquiry 大数相加
- hdu1047 Integer Inquiry 多次大数相加
- HDU ACM 1047 Integer Inquiry->大数相加
- HDOJ 1047 Integer Inquiry(多次大数相加)
- poj1503 Integer Inquiry (大数相加)
- hust Integer Inquiry(字符串,大数相加)
- lynx安装及配置
- 页面搭建的问题
- dos常用命令用法详解-dir
- 计算器实现(c++)
- java处理excel的jxl, POI对比,内存消耗差距大
- POJ 1503 Integer Inquiry【大数相加 java】
- 高级项目管理师个人总结--项目执行
- Linux内核驱动(四):1、进程地址空间
- POJ 1001 求高精度幂【JAVA】
- 如何用DOS命令,获取一个目录下的文件数目
- !!!博弈论基础: 巴什博奕+威佐夫博奕+尼姆博弈
- VC2010横空出世 C++0x初露锋芒
- Review on existing open-source Register Allocation algorithms with GCC\LLVM
- Longest Substring Without Repeating Characters