摘要:
uva748 - ExponentiationExponentiationProblems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the national debt is a taxing experience for many computer systems.This problem requires that you write a program to compute the e 阅读全文
摘要:
uva 465 - OverflowOverflowWrite a program that reads an expression consisting of two non-negative integer and an operator. Determine if either integer or the result of the expression is too large to be represented as a ``normal'' signed integer (typeintegerif you are working Pascal, typeinti 阅读全文
摘要:
/*1.高精度加法2.高精度减法 3.高精度乘法 4.高精度除以低精度 5.高精度对低精度的取余 必要时可以将全局的int替换成long long.除了main函数的返回值int用到除法和取余的时候可能需要把全局的int替换成long long */#include #include #include #include using namespace std;#define maxn 30000struct bign{ int len, s[maxn]; bign() { memset(s, 0, sizeof(s)); len = 1; }... 阅读全文
摘要:
uva 694 - The Collatz Sequence这道题值得一提的是,用int会超出运算范围,所以while里面会陷入死循环而超时。故要用long long.顺便地,int 范围差不多在 2,000,000,000 二十亿左右,看测试数据都知道超int了。/*这道题值得一提的是,用int会超出运算范围,所以while里面会陷入死循环而超时。故要用long long.顺便地,int 范围差不多在 2,000,000,000 二十亿左右,看测试数据都知道超int了。 */#include #include using namespace std;int main(){ long l... 阅读全文