看板 Grad-ProbAsk 關於我們 聯絡資訊
想請問a b c 要怎麼推? http://i.imgur.com/pNPWiXf.jpg http://i.imgur.com/5224c89.jpg -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 182.235.130.102 ※ 文章網址: https://www.ptt.cc/bbs/Grad-ProbAsk/M.1483580162.A.19D.html
h04mp6286: 全部的原理都是在for裡面會分成兩隻 只是在哪裡print 01/05 09:58
h04mp6286: a)先做完5輪的fork再print:2^5=32 01/05 10:00
h04mp6286: b)每次fork前print做10次:1+2+4+...+2^9=1023 01/05 10:02
h04mp6286: c)同a只是變成做計算做3輪:"15\n"*8行 01/05 10:05
h04mp6286: 註:"\n"就是換行字元 01/05 10:07
h9638512: 我懂了 謝謝!! 01/05 12:02