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. appDelegate中的委托协议方法以及使用观察者模式获取其触发方法

    //当应用程序将要进入非活动状态执行,在此期间,应用程序不接受消息或事件,比如来电 - (void)applicationWillResignActive:(UIApplication *)appli ...

  2. ORA-12154 TNS无法解析指定的连接标识符

    又是这个百无聊赖的问题,尽管问题芝麻点大,却让我们好找啊! 非常久没有安装oracle了.今天安装11g的时候,用PLSQL Developer连接时,就出现了这个俗不可耐的问题:ORA-12154 ...

  3. Cocos2dx 小技巧(十一) 小人虽短,但能够旋转

    转眼五一就到了,放假三天应该做些什么呢?窝在家里钻研技术?写博客?no no no no,这样的"伤害"自己的方式实在让我无法忍受.本来和大学那伙人越好了一起去哪里玩玩,喝酒聊天啥 ...

  4. php获取内容中第一张图片地址

    $note = '<img src="http://images.xxx.com/article/cover/201601/20/141539161273.png?imageView2 ...

  5. 增强的for循环(或foreach)

    增强的for循环(也称为foreach循环):不用下标变量,顺序的訪问整个数组.不能以其它顺序訪问数组,或者改变数组的元素. for(elementType element: arrayRefVar) ...

  6. jquery美化滚动条插件jscrollpane应用(转)

    原文地址:http://www.jqcool.net/jquery-jscrollpane.html jScrollPane是一个设计非常灵活的跨浏览器的jQuery ,它将浏览器的默认滚动条或是元素 ...

  7. J2EE它是一个框架?平台?规范?

    一.J2EE究竟是什么 百度百科上说J2EE是框架.假设没有人给我讲.假设我不去各种论坛上去找,我可能就会让自己生硬的接受这个说法了.可实际上,我非常幸运,我有一个团队帮助我一起进步. 事实上总的说起 ...

  8. sap 三代出口(BADI)的查找方法

    sap 三代出口(BADI)的查找方法 对于根据事务代码查找对应的BADI,网上介绍的方法很多,但总结下来无非就两种方法,在此把它记录下来,方便以后自己查阅了.(1)通过SE24,输入CL_EXITH ...

  9. 用java开发的网站或者程序

    中国移动的官网即其相关业务系统 阿里巴巴.淘宝网 58同城是java做的后台 铁道部12306 腾讯的拍拍网等 各大银行的交互应用系统,比如有的信用卡网银 另外,Android手机的大部分应用,其他智 ...

  10. NAT技术基本原理与应用

    转载自:http://www.cnblogs.com/derrick/p/4052401.html?utm_source=tuicool&utm_medium=referral#undefin ...