2012年3月17日

Product:java高精度乘法

摘要: 还是 java 简单! 1 import java.io.*; 2 import java.math.*; 3 import java.util.*; 4 public class Main 5 { 6 public static void main(String[] args) 7 { 8 BigDecimal a,b; 9 Scanner cin=new Scanner(System.in);10 while(cin.hasNextBigDecimal())11 {12 a=cin.ne... 阅读全文

posted @ 2012-03-17 12:48 getgoing 阅读(1101) 评论(0) 推荐(0) 编辑

WA: Product

摘要: 和前面的高精度加法一样,实在找不到原因,之前的大数从来没这样的。。/* UVa 10106 - Product */# include <stdio.h># include <string.h># define MAXN 252char a[MAXN], b[MAXN];char ss[2 * MAXN];void pro(char *s);int main(){ int lena, lenb, i, j, tmp; while (~scanf("%s", a)) { scanf("%s", b); lena = str... 阅读全文

posted @ 2012-03-17 10:47 getgoing 阅读(210) 评论(0) 推荐(0) 编辑

华丽的大数类,华丽的AC:Integer Inquiry

摘要: 参考《算法竞赛入门经典》(刘汝佳)中大数类的实现,终于 AC 了;使用大数类写着感觉很轻松,AC 得也很轻松。。不过还没找到 C 代码 WA 的原因。 1 /* UVa 424 - Integer Inquiry */ 2 # include <iostream> 3 # include <string> 4 # include <cstring> 5 # include <algorithm> 6 7 using namespace std; 8 9 const int maxn = 105;10 11 struct bign{12 int l 阅读全文

posted @ 2012-03-17 00:09 getgoing 阅读(236) 评论(1) 推荐(0) 编辑

导航