Integer Inquiry -TJU1112】的更多相关文章

作为最简单的高精度加法,要注意的是如下几点, 第一,因为是数位达到上百位的大数,所以只能用字符串数组来存贮. 第二,为了方便之后的相加操作,应该把字符串数组逆序转化为一个整型数组. 第三,在控制进位的时候,应该用一个工具变量,假设为h,则h初始值为0.之后在循环体里h是等于对应位的两个数相加之后/10,使得下一次循环时,高位可以进位. 第四,因为已经把原来读取的大数用字符数组读入后又逆序复制到一个新的整型数组里,所以此时下标小的保存的就是低位,这个时候再控制循环变量从低位一直加到高位,多余的位都…
Integer Inquiry Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 11678    Accepted Submission(s): 2936 Problem Description One of the first users of BIT's new supercomputer was Chip Diller. He ex…
Integer Inquiry Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 27730   Accepted: 10764 Description 题目链接:http://poj.org/problem?id=1503 One of the first users of BIT's new supercomputer was Chip Diller. He extended his exploration of pow…
 Integer Inquiry  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.…
/* Integer Inquiry Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 15874 Accepted Submission(s): 4079 Problem Description One of the first users of BIT's new supercomputer was Chip Diller. He exte…
Integer Inquiry Time Limit:1000MS     Memory Limit:10000KB     64bit IO Format:%I64d & %I64u Submit Status 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 a…
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=1047 Integer Inquiry 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 t…
之前杭电上也做过a + b的高精度的题,不过这道题的区别是有多组数据. 之前做的时候开了3个字符数组a,b,c,在计算的时候还要比较a,b长度,短的那个还要加'0',还设置了一个add来存放进位. 现在看来这种算法确实很繁琐. 而这次只用了两个字符数组,一个放加数,一个放和. 相比之前程序更短小了,而且可读性也提高了. 果然办法都是逼出来的. 没有了add,在判断进位的时候就看那一位的ASCII码是否>'9',然后进位. 尤其需要注意的一点是可能会出现连续进位的情况,比如99999 + 1.解决…
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 explorati…
Integer Inquiry Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 15221    Accepted Submission(s): 3912 Problem Description One of the first users of BIT's new supercomputer was Chip Diller. He ex…