1.链接地址:

http://poj.org/problem?id=1503

2.题目:

Integer Inquiry
Time Limit: 1000MS   Memory Limit: 10000K
Total Submissions: 28115   Accepted: 10925

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.)

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.

Output

Your program should output the sum of the VeryLongIntegers given in the input.

Sample Input

123456789012345678901234567890
123456789012345678901234567890
123456789012345678901234567890
0

Sample Output

370370367037037036703703703670

Source

3.思路:

4.代码:

 #include "stdio.h"
#include "string.h"
#define NUM 102
int a[NUM];
int main()
{
char b[];
int len;
int max=;
int i;
gets(b);
while(b[]-''!= || strlen(b)!=)
{
len = strlen(b);
for(i=len-;i>=;i--)
{
a[len--i]+=b[i]-'';
if(a[len--i]>=) {a[len--i+]++;a[len--i]-=;}
}
i=len;
while(a[i]>=){a[i+]++;a[i]-=;i++;}
gets(b);
}
i=NUM-;
while(a[i]==)i--;
while(i>=)
{
printf("%c",a[i]+'');
i--;
}
return ;
}

Poj 1503 Integer Inquiry的更多相关文章

  1. POJ 1503 Integer Inquiry 大数 难度:0

    题目链接:http://poj.org/problem?id=1503 import java.io.*; import java.math.BigInteger; import java.util. ...

  2. poj 1503 Integer Inquiry (高精度运算)

    题目链接:http://poj.org/problem?id=1503 思路分析: 基本的高精度问题,使用字符数组存储然后处理即可. 代码如下: #include <iostream> # ...

  3. POJ 1503 Integer Inquiry(大数相加)

    一.Description One of the first users of BIT's new supercomputer was Chip Diller. He extended his exp ...

  4. POJ 1503 Integer Inquiry(大数相加,java)

    题目 我要开始练习一些java的简单编程了^v^ import java.io.*; import java.util.*; import java.math.*; public class Main ...

  5. POJ 1503 Integer Inquiry 简单大数相加

    Description One of the first users of BIT's new supercomputer was Chip Diller. He extended his explo ...

  6. Integer Inquiry【大数的加法举例】

    Integer Inquiry Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 27730   Accepted: 10764 ...

  7. hdu acm-1047 Integer Inquiry(大数相加)

    Integer Inquiry Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)T ...

  8. 424 - Integer Inquiry

     Integer Inquiry  One of the first users of BIT's new supercomputer was Chip Diller. He extended his ...

  9. hdu1047 Integer Inquiry

    /* Integer Inquiry Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) ...

随机推荐

  1. 通过Wifi调试Android应用

    国内私募机构九鼎控股打造APP,来就送 20元现金领取地址:http://jdb.jiudingcapital.com/phone.html内部邀请码:C8E245J (不写邀请码,没有现金送)国内私 ...

  2. Python 魔术方法指南

    入门 构造和初始化 构造定制类 用于比较的魔术方法 用于数值处理的魔术方法 表现你的类 控制属性访问 创建定制序列 反射 可以调用的对象 会话管理器 创建描述器对象 持久化对象 总结 附录 介绍 此教 ...

  3. MySQL 性能监控 4 大指标

    [编者按]本文作者为 John Matson,主要介绍 mysql 性能监控应该关注的 4 大指标. 文章系国内 ITOM 管理平台 OneAPM 编译呈现.    MySQL 是什么? MySQL  ...

  4. PHP之open_ssl

    http://www.wapm.cn/phpdoc/zh/openssl.installation.html http://liuxufei.com/weblog/jishu/376.html dem ...

  5. cocos2d-x引擎实现$1Unistroke Recognizer手势识别

    $1 Unistroke(单笔画) Recognizer官网 http://depts.washington.edu/aimgroup/proj/dollar/ (在官网还有多笔画的识别库) 代码下载 ...

  6. php读取图片成二进制流输出

    header( "Content-type: image/jpeg");$PSize = filesize('1.jpg');$picturedata = fread(fopen( ...

  7. 显示/去掉CONSOLE窗口

    众所周知,控制台应用程序一般都会显示一个控制台窗口(虚拟DOS窗口),但很多时候控制台程序的执行逻辑根本不需要与用户进行交互,所以显示这个难看的窗口纯属多余,那么如何将它屏蔽掉呢?下面我向大家介绍一种 ...

  8. sql时间段算法

    需求:领导要求写时间段算法,格式如下 :-: :-: :-: :-: :-: :-: :-: :-: :-: :-: :-: :-: :-: :-: :-: :-: 一小时制 :-: :-: :-: ...

  9. 蓝牙 GameKit

    一.准备工作 1.搭建UI  2.拖线 // 图片 @property (weak, nonatomic) IBOutlet UIImageView *imageView; // 建立连接 - (IB ...

  10. dedecms获取栏目下的频道列表

    可以使用: {dede:channelartlist}标签  使用方法: {dede:channelartlist row='6'} <dl>  <dt><a href= ...