- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
手动乘法模拟实验(Manual multiplication simulation experiment)
手动乘法模拟实验(Manual multiplication simulation experiment)
/ ****************************************************
以下程序是为了模拟手动乘法,即按照乘法口诀,
一位一位的去计算。
**************************************************** /
/ ****************************************************
100阶乘算法作者提供最关键的进位算法感谢。
本代码将会在百度文库、CSDN、豆丁同步共享,
不涉及任何版权,闲来无事,写着玩,
当然,里面还有某些不尽人意的地方,
欢迎广大编程爱好者交流讨论,
来信请寄:taiyangshen80292@
**************************************************** /
#包括 stdio. h
无效array_plus_num(int b,[ ],[ ] a_digit int结果,int,int length);
无效array_plus_array(int [],int b [ ],[ ] b_digit int结果,int,int a_digit,int length);
无效array_mul_num(int b,[ ],[ ] a_digit int结果,int,int length);
无效array_mul_array(int [],int b [ ] [ ] result_1,int,int result_2 [ ] [ ] result_3,int,int a_digit,int b_digit,int length);
无效array_mul_array(int [],int b [ ] [ ] result_1,int,int result_2 [ ] [ ] result_3,int,int a_digit,int b_digit,int length)
{
int,j,k,l;
为(i = 0;i b_digit;i++)
{
/ *数组一×数字B,结果存放在result_1中*/
array_mul_num(A、B [长度-我- 1 ],result_1,a_digit,长度);
/ * result_1左移我位!* /
对于(k=0;k i;k + +)
{
对于(j = 1;j 长度;j + +)
{
result_1 [ J ] = 1 result_1 [J].;
}
result_1 [长度- 1 ] = 0;/*低位补零*/
}
/ *数组B加到数组一上,结果存放在结果中*/
/ *数组一中存放原始数据,不是同一个数据存储单元!* /
/ *无效array_plus_array(int [],int b [ ],[ ] b_digit int结果,int,int a_digit,int length)* /
array_plus_array(result_2 / * * /上次结果,result_1 / * * /当次结果,result_3 / * * /二结果相加,b_digit,a_digit,长度);
result_3→result_2 * / / *
对于(l = 0;l 长度;++)
{
result_2 [1] = result_3 [1];
}
}
}
*************************************************************************************************** / /
无效array_mul_num(int b,[ ],[ ] a_digit int结果,int,int length)
{
/静态计数= 0;
int = 0;
int = 0;
int进位=0;
/如果(计数= 0)
{
对于(j = 0;j 长度;j + +)
{
结果[ j ];
}
}
(J = 1,为开展= 0;J = a_digit;j++)
{ //载:进位
温度=结果[ length-j ] * B +携带;/ /相乘(加上进位)
结果[长] =温度% 10;/ /更新临时结果的位上信息
携带=温度/ 10 / /看是否有进位;
}
虽然(携带)
{ //如果有进位
结果[ 1 ] =长a_digit进行% 10;/ /新加一位,添加信息。
位数增1
The _ digit + +;
Carry = carry / 10; / / 看还能不能进位
}
/ / count + +;
}
/ * * * * * * * * *
您可能关注的文档
- 如果你想读书,以下是必读的经典(If you want to study, here are the classics you must read).doc
- 如果你身边的人胃不好(If the person around you has a bad stomach).doc
- 如果你胃不好,请保存下来(If you have a bad stomach, please keep it).doc
- 妈妈心得,值得参照和学习(Mother's experience, worth reference and learning).doc
- 妈妈的素质有多高,孩子就能飞多远(How high is mother's quality How far can a child fly).doc
- 妈妈真辛苦(例文)(Mom, it's hard (Li Wen)).doc
- 如何通过分析均线来得知走势(How do you know the trend by analyzing average moving averages).doc
- 如何通过语言影响客户购买决策(How to influence customer purchase decisions through language).doc
- 如何鉴别e63水货与翻新机(How to identify E63 parallel and refurbished machines).doc
- 威尼斯商人人物简介(A brief account of businessmen in Venice).doc
- 所得税管理存在的问题及对策(Problems and Countermeasures of income tax management).doc
- 手动挡汽车与自动挡汽车区别(The difference between manual car and automatic car).doc
- 手工打造微型win32可执行文件pe(Manual build Mini Win32 executable file PE).doc
- 手把手教你无线路由器的桥接和覆盖(Teach you how to bridge and overlay wireless routers).doc
- 手指半月牙如何看健康(How do you look at your health with your fingers and half moon).doc
- 手工香皂(Handmade Soap).doc
- 手指心算速算口诀(Finger arithmetic pithy formula).doc
- 我的新闻(My news).doc
- 我的为一(My one for one).doc
- 手指长度决定什么(What does finger length decide).doc
最近下载
- 思想政治学科教学新论七章 思想政治学科评价论.ppt VIP
- 2025江西南昌青山湖区城市管理和综合执法局招聘工作人员10人笔试参考题库附答案解析.docx VIP
- 04S519:小型排水构筑物.pdf VIP
- GB50017钢结构设计规范.pdf VIP
- 武汉文化投资发展集团有限公司招聘5名工作人员笔试备考试题及答案解析.docx VIP
- 2023全钒液流电池可靠性评价方法.pdf VIP
- [乐高LEGO 9686动力机械]第14课 摩天轮.pdf VIP
- 英语视听说4英语视听说IV教学大纲.pdf VIP
- 基根-《全球营销(第8版)》英文教辅-第4章.pptx VIP
- 基根-《全球营销(第8版)》英文教辅-第3章.pptx VIP
文档评论(0)