[問題] 大數相乘問題
看板Prob_Solve (計算數學 Problem Solving)作者Raisto (劉大俠)時間14年前 (2011/01/07 23:25)推噓2(2推 0噓 27→)留言29則, 3人參與討論串1/1
假設有兩組數要相乘
2 3 4 5 6
3 4 1 2 4
而又假設一次只能算4 X 4,所以我將其切成
2 | 3 4 5 6
3 | 4 1 2 4
先行計算3456 X 4124,最後再將其整合計算
所以假設
W = 34
X = 56
Y = 41
Z = 24
那麼
P = WY = 34 X 41
=1394
Q = XZ = 56 X 24
= 1344
R = (W+X)(Y+Z)
= (34+56)(41+24)
= (90)(65)
= 5850
進行運算
P X 10^4 + (R-P-Q) X 10^2 + Q
= 1394 X 10^4 + (5850-1394-1344) X 10^2 +1344
= 13940000+311200+1344
= 14252544
得到了14252544後,我要如何再傳回去跟還未計算的數字做Merge?
最終答案應該是800412544,目前小弟不太懂的就是
我要如何把目前的結果(14252544),變成最終答案?
有請各位大大解惑,小弟感恩
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.169.77.33
→
01/07 23:50, , 1F
01/07 23:50, 1F
→
01/07 23:51, , 2F
01/07 23:51, 2F
→
01/08 00:00, , 3F
01/08 00:00, 3F
→
01/08 00:00, , 4F
01/08 00:00, 4F
→
01/08 00:01, , 5F
01/08 00:01, 5F
→
01/08 00:02, , 6F
01/08 00:02, 6F
→
01/08 00:04, , 7F
01/08 00:04, 7F
→
01/08 00:04, , 8F
01/08 00:04, 8F
→
01/08 09:00, , 9F
01/08 09:00, 9F
→
01/08 09:01, , 10F
01/08 09:01, 10F
推
01/08 09:40, , 11F
01/08 09:40, 11F
→
01/08 11:53, , 12F
01/08 11:53, 12F
→
01/08 13:16, , 13F
01/08 13:16, 13F
→
01/08 13:16, , 14F
01/08 13:16, 14F
→
01/08 13:17, , 15F
01/08 13:17, 15F
→
01/08 13:17, , 16F
01/08 13:17, 16F
→
01/08 13:21, , 17F
01/08 13:21, 17F
推
01/08 13:22, , 18F
01/08 13:22, 18F
→
01/08 13:23, , 19F
01/08 13:23, 19F
→
01/08 13:23, , 20F
01/08 13:23, 20F
→
01/08 13:23, , 21F
01/08 13:23, 21F
→
01/09 00:16, , 22F
01/09 00:16, 22F
→
01/09 10:38, , 23F
01/09 10:38, 23F
→
01/09 20:51, , 24F
01/09 20:51, 24F
→
01/09 20:51, , 25F
01/09 20:51, 25F
→
01/09 20:52, , 26F
01/09 20:52, 26F
→
01/09 20:52, , 27F
01/09 20:52, 27F
→
01/09 20:52, , 28F
01/09 20:52, 28F
→
01/09 20:54, , 29F
01/09 20:54, 29F
Prob_Solve 近期熱門文章
PTT數位生活區 即時熱門文章