摘要: 简单的高精度加法,LRJ白书的模板。只是脑残了下,忘记回车了#include <cstdio>#include <cstring>#include <iostream>using namespace std;const int maxn=1000;struct bign{ int len,s[maxn],flag;//flag 为表示正负备用 bign() {memset(s,0,sizeof(s));len=1;} bign operator = (const char* num) { len=strlen(num); for(int i=0;i<l 阅读全文
posted @ 2012-12-19 18:04 Wxy191 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 高精度乘法题目,用了LRJ白书的模板。WA了许多次。注意点:1.前导零需要过滤,应该写个函数(我直接偷懒用加法搞定了) 2.乘法、加法的进位。最后,模板不一定是最好的,适合自己的,自己写的出来的才是最好的。最后再送几组测试用例input:022222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999999999999999999999999999999999999999999999999999999999... 阅读全文
posted @ 2012-12-19 18:02 Wxy191 阅读(333) 评论(0) 推荐(0) 编辑