หัวข้อ: Euclidean algorithm
ดูหนึ่งข้อความ
  #7  
Old 07 เมษายน 2016, 11:29
share share ไม่อยู่ในระบบ
ลมปราณไร้สภาพ
 
วันที่สมัครสมาชิก: 23 เมษายน 2013
ข้อความ: 1,211
share is on a distinguished road
Default

...สื่อสาร (สอบ)ทานง่าย ฉายประโยชน์
บ่โกรธ ผู้มัก ซักถาม
เข้าใจ ไขแจ้ง กระจ่างความ
ไป่ปล่อย รอยหนาม คาใจ


Euclidean algorithm can be used to find the greatest common divisor of a = 1071 and b = 462.

To begin, multiples of 462 are subtracted from 1071 until the remainder is less than 462.
Two such multiples can be subtracted (q0 = 2), leaving a remainder of 147:
1071 = 2 × 462 + 147.

Then multiples of 147 are subtracted from 462 until the remainder is less than 147.
Three multiples can be subtracted (q1 = 3), leaving a remainder of 21:
462 = 3 × 147 + 21.

Then multiples of 21 are subtracted from 147 until the remainder is less than 21.
Seven multiples can be subtracted (q2 = 7), leaving no remainder:
147 = 7 × 21 + 0.

Since the last remainder is zero,
the algorithm ends with 21 as the greatest common divisor of 1071 and 462.

07 เมษายน 2016 11:34 : ข้อความนี้ถูกแก้ไขแล้ว 1 ครั้ง, ครั้งล่าสุดโดยคุณ share
ตอบพร้อมอ้างอิงข้อความนี้