POJ 1503 Integer Inquiry(大数相加,java)
我要开始练习一些java的简单编程了^v^
import java.io.*;
import java.util.*;
import java.math.*; public class Main { /**
* @param args
*/
public static void main(String[] args) throws Exception {
// 定义并打开输入文件
Scanner cin = new Scanner(System.in); BigInteger a, sum, zero; //大数定义
sum = BigInteger.ZERO; //置零
zero = BigInteger.valueOf(0); //置零 while(cin.hasNext()) { //判断是否输入结束
a = cin.nextBigInteger() ; //大数输入
if(a.equals(zero)) { //判断是否等于0
break;
}
sum = sum.add(a); //大数相加
}
System.out.println(sum); //输出结果 cin.close(); //关闭输入文件
} }
POJ 1503 Integer Inquiry(大数相加,java)的更多相关文章
- POJ 1503 Integer Inquiry(大数相加)
一.Description One of the first users of BIT's new supercomputer was Chip Diller. He extended his exp ...
- POJ 1503 Integer Inquiry 大数 难度:0
题目链接:http://poj.org/problem?id=1503 import java.io.*; import java.math.BigInteger; import java.util. ...
- hdu acm-1047 Integer Inquiry(大数相加)
Integer Inquiry Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)T ...
- Poj 1503 Integer Inquiry
1.链接地址: http://poj.org/problem?id=1503 2.题目: Integer Inquiry Time Limit: 1000MS Memory Limit: 1000 ...
- HDU 1047 Integer Inquiry 大数相加 string解法
本题就是大数相加,题目都不用看了. 只是注意的就是HDU的肯爹输出,好几次presentation error了. 还有个特殊情况,就是会有空数据的输入case. #include <stdio ...
- POJ 1503 Integer Inquiry 简单大数相加
Description One of the first users of BIT's new supercomputer was Chip Diller. He extended his explo ...
- poj 1503 Integer Inquiry (高精度运算)
题目链接:http://poj.org/problem?id=1503 思路分析: 基本的高精度问题,使用字符数组存储然后处理即可. 代码如下: #include <iostream> # ...
- Integer Inquiry(大数相加)
Description One of the first users of BIT's new supercomputer was Chip Diller. He extended his explo ...
- Integer Inquiry 大数加法
Integer Inquiry 1 import java.util.*; 2 import java.math.*; 3 import java.io.*; 4 import java.text.* ...
随机推荐
- hdu 4198 Quick out of the Harbour
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=4198 Quick out of the Harbour Description Captain Cle ...
- centos 安装phantomjs
sudo yum install gcc gcc-c++ make git openssl-devel freetype-devel fontconfig-devel git clone git:// ...
- MNC - Multicast NetCat
MNC - Multicast NetCat 使用nc测试udp多播,总是遇到奇怪的问题,搞的一头雾水.偶然发现了MNC,测试了一下果然好用. 下载地址: https://github.com/mar ...
- HTML a 标签 下载 apk 文件
代码: <a href="http://www.abc2016.com/phone_Client/shouji.apk" class="download_inp ...
- 从JetBrains公司产品给我的商业模式启示
JetBrains是捷克一家公司,专门从事IDE工具的开发,运营的产品有十几个.我因为使用JavaScript IDE工具而了解了WebStorm.进而了解了开发WebStorm的公司JetBrian ...
- 读Windows编程
1.Windows是一个消息驱动系统.它通过把消息投入应用程序消息队列中或者把消息发送给合适的窗口消息处理程序,将发生的各种事件通知给应用程序 2.尽管一个动态链接库模块可能有其它扩展名(如.EXE或 ...
- h264码流分析
---------------------------------------------------------------------------------------------------- ...
- 移植net-snmp到开发板(mini210)
1.安装交叉编译工具arm-linux-gcc 2.下载net-snmp源码安装包 3.解压安装包 4../configure --build=i686-linux --host=arm-linux ...
- 嵌入字体@font-face
嵌入字体@font-face @font-face能够加载服务器端的字体文件,让浏览器端可以显示用户电脑里没有安装的字体. 语法: @font-face { font-family : 字体名称; s ...
- 制作C/C++动态链接库(dll)若干注意事项
一.C\C++ 运行时库编译选项简单说明 问题:我的dll别人没法用 运行时库是个很复杂的东西,作为开发过程中dll制作需要了解的一部分,这里主要简单介绍一下如何选择编译选项. 在我们的开发过程中时常 ...