![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
高精度算法
文章平均质量分 77
十六鹤井
这个作者很懒,什么都没留下…
展开
-
C++从入门到入土-回文数(高精度算法)
回文数(高精度算法)题目如下:可能是高精度算法的吧...#include<cstdio> #include<cctype> #include<cstring> #include<cstdlib> #define maxn 100 using namespace std; int n,a[2][maxn]; char s[m...原创 2018-04-14 11:27:00 · 791 阅读 · 1 评论 -
C++从入门到入土-4.14下午的测试n!!道题(乘法篇)
从此走上不归路…一、高精度乘法耿直给代码://高精度乘法 #include<cstdio> #include<cstring> int main() { char num1[1500], num2[1500]; scanf("%s%s", num1, num2); int n = strlen(num1), m = strlen(num2); ...原创 2018-04-14 15:59:10 · 270 阅读 · 0 评论 -
C++从入门到入土-高精度加法
高精度算法一、高精度加法1、计算结果的位数2、将要计算的数字分割成多段,按照顺序排列3、将两数相加。4、输出结果。从高位到低位依次输出。除最高位以外,其他低位上不足4位的要在前面补上0。核心代码:int c[100]; //a,b,c都为数组(可用字符数组),分别储存被加数、加数、结果 void add(int a[],int b[]) { int i=1,x=0; while((...原创 2018-04-13 21:42:18 · 643 阅读 · 0 评论 -
C++从入门到入土-高精度除法
PS:爱c++爱未来一、高精度除以低精度采取按位相除法。#include<cstdio> #include<iostream> using namespace std; const int maxn=1010; char a1[maxn],c1[maxn]; int a[maxn],c[maxn],x=0,b,lena,lenc,i; int main() { freop...原创 2018-04-20 21:46:36 · 11796 阅读 · 4 评论