[問題] 連續整數相乘,求乘積最大?
看板Prob_Solve (計算數學 Problem Solving)作者polomoss (小澤)時間16年前 (2008/05/14 23:16)推噓10(10推 0噓 6→)留言16則, 7人參與討論串1/6 (看更多)
希望大大給點想法,今天寫題目的時候卡住了~
講的越詳細越好~~
使用者給一串整數,要找出它"連續",且乘積最大者
例如:
5 -2 1 -1 最大 5*-2*1*-1 = 20
-1 2 5 最大 2*5 = 10
1 2 0 -3 -1 最大 -3*-1 = 3
大概是這樣~~
先謝謝了~
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.168.203.120
→
05/14 23:39, , 1F
05/14 23:39, 1F
→
05/14 23:58, , 2F
05/14 23:58, 2F
推
05/15 00:02, , 3F
05/15 00:02, 3F
→
05/15 00:14, , 4F
05/15 00:14, 4F
推
05/15 02:18, , 5F
05/15 02:18, 5F
推
05/15 02:23, , 6F
05/15 02:23, 6F
推
05/15 03:56, , 7F
05/15 03:56, 7F
推
05/15 04:52, , 8F
05/15 04:52, 8F
推
05/15 04:53, , 9F
05/15 04:53, 9F
推
05/15 10:53, , 10F
05/15 10:53, 10F
→
05/15 10:53, , 11F
05/15 10:53, 11F
→
05/15 11:23, , 12F
05/15 11:23, 12F
→
05/15 11:23, , 13F
05/15 11:23, 13F
推
05/15 17:44, , 14F
05/15 17:44, 14F
推
05/15 17:45, , 15F
05/15 17:45, 15F
推
05/15 17:56, , 16F
05/15 17:56, 16F
討論串 (同標題文章)
Prob_Solve 近期熱門文章
PTT數位生活區 即時熱門文章