大数乘法
来源:互联网 发布:spss20软件怎么安装 编辑:程序博客网 时间:2024/05/16 16:13
# include<stdio.h># include<string.h># include<stdlib.h>void multiply(char* a,char* b,char* c){ int i,j,ca,cb,* s; ca=strlen(a); cb=strlen(b); s=(int*)malloc(sizeof(int)*(ca+cb)); for (i=0;i<ca+cb;i++) s[i]=0; for (i=0;i<ca;i++) for (j=0;j<cb;j++) s[i+j+1]+=(a[i]-'0')*(b[j]-'0'); for (i=ca+cb-1;i>=0;i--) if (s[i]>=10) { s[i-1]+=s[i]/10; s[i]%=10; } i=0; while (s[i]==0) i++; for (j=0;i<ca+cb;i++,j++) c[j]=s[i]+'0'; c[j]='\0'; free(s);}
http://blog.csdn.net/chichangjing1/article/details/8619152
0 0
- 大数乘法
- 大数乘法
- 大数乘法
- 大数乘法
- 大数乘法
- 大数乘法
- 大数乘法
- 大数乘法
- 大数乘法
- 大数乘法
- 大数乘法
- 大数乘法
- 大数乘法
- 大数乘法
- 大数乘法
- 大数乘法
- 大数乘法
- 大数乘法
- Excel Sheet Column Title
- CentOS6.5安装时使用GPT分区#ext4文件系统#XFS文件系统
- 【大话】装饰模式与建造者模式
- RO段、RW段和ZI段 --Image$$??$$Limit 含义
- java 实现微信搜索附近人功能
- 大数乘法
- boost::shared_ptr
- redis学习笔记
- 二叉树的遍历
- https://oj.leetcode.com/problems/majority-element/
- 黑马程序员——反射
- 【转】FILE *fp fopen 参数
- HDU 1061 N^N (n的n次方的最后一位)
- chromatix 5.4.3安装打开失败license过期