码迷,mamicode.com
首页 >  
搜索关键字:高精度    ( 1735个结果
(高精度)大数加减法C++实现
前言 这两天在刷算法题,其中涉及到了高精度算法,由于笔者使用C++,所以需要手动去模拟实现。使用java和python的同学可以不用担心,Java有BigDecimal类可以实现,python可以直接实现。 好了下面我们直接上代码,代码都有相应的注释,相信可以看懂的。 代码 更多内容大家可以访问我的 ...
分类:编程语言   时间:2020-03-12 12:44:18    阅读次数:58
高精度乘以高精度
1 #include<bits/stdc++.h> 2 using namespace std; 3 const int N = 1e5; 4 char A[N],B[N]; 5 int a[N],b[N],c[N],na,nb; 6 void change(){ 7 for(int i=0; i< ...
分类:其他好文   时间:2020-03-11 01:32:29    阅读次数:74
高精度减法
1 #include<bits/stdc++.h> 2 3 using namespace std; 4 5 const int N = 1e5+5; 6 7 char a[N],b[N]; 8 9 struct bign{ 10 int d[N]; 11 int len; 12 bign(){ 1 ...
分类:其他好文   时间:2020-03-11 01:16:04    阅读次数:44
高精度计算
高精度运算,是指参与运算的数(加数,减数,因子……)范围大大超出了标准数据类型(整型,实型)能表示的范围的运算。例如,求两个20000位的数的和。这时,就要用到高精度算法了。 1、高精度加法 #include<cstdio>#include<iostream>#include<cstring>usi ...
分类:其他好文   时间:2020-03-10 20:07:47    阅读次数:76
回文数(内含高精度加法,字符串是否为回文的判断)
#include<iostream> #include<string> using namespace std; const int Max = 550; int Compare(int a[], int b[]); void Plus(int a[], int b[], int n); void ...
分类:其他好文   时间:2020-03-09 18:21:30    阅读次数:73
高精度减法
#include<iostream> #include<string> using namespace std; const int Max = 20000; int Compare(int a[], int b[]); //比较大小 void Subtract(int a[], int b[]); ...
分类:其他好文   时间:2020-03-09 18:06:28    阅读次数:65
高精度除法
#include<iostream> #include<string> using namespace std; const int Max = 550; void Enlarge(int p[], int q[], int bits); //将数组p的数字串右移bits位 int Compare( ...
分类:其他好文   时间:2020-03-09 17:56:50    阅读次数:52
数楼梯(斐波那契数列+高精度)
逆序思维 当爬到第K级台阶时,上一步只有两种可能,一种是位于K-1,一种是位于K-2 参考https://www.luogu.com.cn/blog/user7117/solution-p1255 #include<iostream> #include<string> using namespace ...
分类:其他好文   时间:2020-03-09 17:56:00    阅读次数:67
高精度 四位压缩
高精度 四位压缩 基本原理: 建立一个数组 每一位上存4位数字 运用一定的方法运算,以实现大整数的运算; 封装在了结构体内; 目前只有高精度+高精度、高精度*单精度、max(高精度,高精度); 代码: //高精度四位压缩 const int M=85,mod=10000; struct HP { i ...
分类:其他好文   时间:2020-03-06 01:05:22    阅读次数:85
java里面的高精度运算
1 package com.lv.study.am.first; 2 3 import java.math.BigDecimal; 4 5 public class TestBigDecimal { 6 7 public static void main(String[] args) { 8 9 / ...
分类:编程语言   时间:2020-03-04 21:14:41    阅读次数:94
1735条   上一页 1 ... 9 10 11 12 13 ... 174 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!