[問題] 程設兩題

看板KS96-310作者 (神經細胞)時間15年前 (2009/05/18 00:52), 編輯推噓2(205)
留言7則, 3人參與, 最新討論串1/2 (看更多)
The gcd of x and y is defined recursively as follows: IF y is equal to 0, then gcd( x, y ) is x; otherwise gcd( x, y ) is gcd( y, x%y ) where % is the remainder operator. Write a recursive function gcd that returns the greatest common divisor of x and y. Write a program that runs 1000 games of craps ( without human intervention ) 我用的是dev-C 現在讀到Pointer這章,Arrays的部分勉強看得懂 程式儘量不要太深奧好嗎 感恩^^ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 134.208.32.218

05/18 11:27, , 1F
毛哥我看不懂英文啊
05/18 11:27, 1F

05/18 16:38, , 2F
GCD應該是最大公因數 craps我也不知道是甚麼,我還在
05/18 16:38, 2F

05/18 16:41, , 3F
想是不是程設的專業術語,電子辭典解釋是"罵人的話",
05/18 16:41, 3F

05/18 16:43, , 4F
不過應該不是叫我們寫一個跑出一千種罵人的遊戲吧XD
05/18 16:43, 4F

05/18 16:45, , 5F
應該是這個
05/18 16:45, 5F

05/18 16:49, , 6F
05/18 16:49, 6F

05/19 00:06, , 7F
一開始就講明用遞迴寫了
05/19 00:06, 7F
文章代碼(AID): #1A443LKg (KS96-310)
討論串 (同標題文章)
文章代碼(AID): #1A443LKg (KS96-310)