高精度处理
&小鹏鹏
邮箱:18140035@bjtu.edu.cn
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
判断数是否可以被整除(大数)
#include #include int main() { char s[200]; while(scanf("%s", &s) == 1) { if(!strcmp(s, "0")) break; int m = 0; for(int i = 0; i < strlen(s); i++) m = (m*10+s[i]-'0')%n;原创 2014-06-29 20:18:26 · 1149 阅读 · 0 评论 -
高精度之 N!的位数
#include #include #include #include using namespace std ; #define PI 3.1415926 #define e 2.718281828459 int main() { __int64 len,n; __int64 T; scanf("%I64d",&T); while (T--)原创 2015-03-15 07:05:03 · 414 阅读 · 0 评论 -
高精度之 加减乘除除取余(课设专用)
#include #include #include #include using namespace std; //compare比较函数:相等返回0,大于返回1,小于返回-1 int compare(string str1,string str2) { if(str1.length()>str2.length()) return 1; else if(str1.length(原创 2015-03-15 07:09:58 · 396 阅读 · 0 评论 -
日期之输入年月输出月历(有点问题)
#include int isly(int year) { return (((!(year%4))&&(year%100))||(!(year%400))); } int mtod(int m) { const static int mday[]={0,0,31,59,90,120,151,181,212,243,273,304,334}; return mday[m]; } int d原创 2015-03-15 07:16:03 · 802 阅读 · 0 评论 -
高精度之 A乘B
/*输入的两个数的长度都是不超过50000的所以非常大,所以用到傅里叶变换, 对于任何一个N位的整数都可以看作是An*10^(n-1) + An-1*10^(n-2) + ... + A2*10^2 + A1*10 + A0。如果把10看作是一个自变量,那么任何一个整数就可以视作为一个多项式,两个整数相乘也便可以看作是两个多项式相乘。对于一个多项式,我们平时所接触到的多是其系数表示法,普通的相乘原创 2015-03-15 07:03:37 · 549 阅读 · 0 评论 -
高精度之 加法(连加)
#include #include #include using namespace std; //高精度加法 //只能是两个正数相加 //输入一个数T有几组连加的,每一组以0结束输出结果,每一组可以有多个测试数据直到遇零位止 string add(string str1,string str2)//高精度加法 { string str; int len1=str1.lengt原创 2015-03-15 07:07:13 · 966 阅读 · 0 评论 -
高精度之 X^y(包含小数的^y幂)
/* sample input : 95.123 12 0.4321 20 5.1234 15 6.7592 9 98.999 10 1.0100 12 sample output: 548815620517731830194541.899025343415715973535967221869852721 .00000005148554641076956121994511276767154838原创 2015-03-15 07:07:39 · 517 阅读 · 0 评论 -
专用计算器计算高精度减法计算器
#include "stdio.h" #include "string.h" /************************************************************************/ /* 高精度减法 (这个函数要a[]>=b[]) */ /* a[]被减数数组,位数不限原创 2015-03-15 07:11:02 · 434 阅读 · 0 评论
分享