<WINGY+ />
Junior Programmer, Software Quality
Pages
หน้าแรก
Alfresco
2/02/2012
หารร่วมมาก (Great Common Divisor)
ช่วงนี้ไม่รู้นึกอะไรชอบไปเล่น
http://programming.in.th/
แล้วก็เจอข้อหาการหารร่วมมาก ตอนแรกก็นั่งนึกอยู่นานว่าจะทำยังไงดีเลยลองหาใน wiki ดูปรากฎว่ามันมีอัลกอริทึมชื่อว่า
"
Euclid"
หาได้โดย
gcd(a, 0) = a
gcd(a, b) = gcd(b, a % b)
ง่ายขิงๆ :)
No comments :
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments ( Atom )
No comments :
Post a Comment