求最大公因数
\u6700\u5927\u516c\u56e0\u6570\u516c\u56e0\u6570\u548c\u6700\u5927\u516c\u56e0\u6570
7 3 14 16
求出下列各组数的最大公因数( 4 6 ) (9 12 ) (5 20)
( 39 26 ) (5 9 ) ( 12 16 )
( 14 21 ) ( 15 25) (18 27 )
( 16 24 ) (19 6 ) (36 16 )
( 4 18 ) ( 12 8 ) ( 45 5 )
(75 50 ) ( 96 72 ) (39 13 )
(24 12 ) (36 48) ( 56 14 )
(15 39 ) ( 25 10 ) ( 9 54 )
( 6 9 ) ( 8 40 ) ( 10 6 )
( 26 91 ) ( 4 90 ) ( 8 6 )
( 17 85 ) ( 21 6 ) ( 58 8 )
( 70 91) ( 18 96 ) ( 16 6 )
( 4 8) ( 42 6 ) ( 51 17)
( 15 9 ) ( 45 30 ) ( 16 3 )
( 7 21 ) ( 10 15 ) ( 18 6 )
( 24 8 ) ( 12 18 ) ( 42 6 )
( 29 26) ( 16 15 ) ( 58 29 )
( 21 9 ) ( 9 15 ) (28 4 )
(45 9 ) ( 13 36 ) ( 19 3 )
( 14 35 ) ( 17 6 ) ( 18 5 )
( 28 8 ) ( 24 18 ) ( 19 3 )
(49 14 ) ( 21 18 ) ( 17 7 )
( 60 15 ) ( 35 10 ) ( 18 8 )
( 42 14 ) ( 26 39 ) ( 15 5 )
( 21 7 ) (28 14 ) ( 35 14 )
( 26 13 ) ( 28 21 ) (13 6 )
( 16 56) ( 35 28 ) (11 55 )
(81 27 ) ( 24 12 ) ( 22 33 )
( 18 5 ) (9 27 ) ( 4 26 )
( 16 6 ) ( 16 6 ) (26 8 )
( 125 625 500 ) ( 140 160 120 )
( 16 18 12 ) (144 96 72 )
( 40 80 120 ) (120 360 180 )
( 36 48 96) (45 18 27 )
(240 360 480 720)
( 240 360 480 720 960 )
( 4 6 ) (9 12 ) (5 20)
( 39 26 ) (5 9 ) ( 12 16 )
( 14 21 ) ( 15 25) (18 27 )
( 16 24 ) (19 6 ) (36 16 )
( 4 18 ) ( 12 8 ) ( 45 5 )
(75 50 ) ( 96 72 ) (39 13 )
(24 12 ) (36 48) ( 56 14 )
(15 39 ) ( 25 10 ) ( 9 54 )
( 6 9 ) ( 8 40 ) ( 10 6 )
( 26 91 ) ( 4 90 ) ( 8 6 )
( 17 85 ) ( 21 6 ) ( 58 8 )
( 70 91) ( 18 96 ) ( 16 6 )
( 4 8) ( 42 6 ) ( 51 17)
( 15 9 ) ( 45 30 ) ( 16 3 )
( 7 21 ) ( 10 15 ) ( 18 6 )
( 24 8 ) ( 12 18 ) ( 42 6 )
( 29 26) ( 16 15 ) ( 58 29 )
( 21 9 ) ( 9 15 ) (28 4 )
(45 9 ) ( 13 36 ) ( 19 3 )
( 14 35 ) ( 17 6 ) ( 18 5 )
( 28 8 ) ( 24 18 ) ( 19 3 )
(49 14 ) ( 21 18 ) ( 17 7 )
( 60 15 ) ( 35 10 ) ( 18 8 )
( 42 14 ) ( 26 39 ) ( 15 5 )
( 21 7 ) (28 14 ) ( 35 14 )
( 26 13 ) ( 28 21 ) (13 6 )
( 16 56) ( 35 28 ) (11 55 )
(81 27 ) ( 24 12 ) ( 22 33 )
( 18 5 ) (9 27 ) ( 4 26 )
( 16 6 ) ( 16 6 ) (26 8 )
( 125 625 500 ) ( 140 160 120 )
( 16 18 12 ) (144 96 72 )
( 40 80 120 ) (120 360 180 )
( 36 48 96) (45 18 27 )
(240 360 480 720)
( 240 360 480 720 960 )
我用c#写的
int
r,a=898440451,b=899160187;
while
(b
!=
0
)
{r
=a%b;
a
=
b;
b
=
r;
}
textBox1.Text=a.ToString();
就是用上面的辗转相除法
用递归函数是
int
gcd(a,
b)
{
if
a
mod
b<>0
return
gcd(b,
a
mod
b);
else
return
a;
}
textBox1.Text=gcd(898440451,b=899160187).ToString();
都用人教版的吧 ,不用特意找。
冒个泡。。。
绛旓細鏈澶у叕鍥犳暟鐨勬眰娉曪細鏋氫妇娉曪細鎵璋撴灇涓炬硶锛屽氨鏄皢涓や釜鏁扮殑鍥犳暟鍒嗗埆鍒椾妇鍑烘潵锛屽啀浠庝腑鎵惧埌浠栦滑鐨勫叕鍥犳暟锛屾渶鍚庝粠鍏洜鏁颁腑鎵惧埌鏈澶х殑鍏洜鏁般備緥濡傛眰6銆15鐨勬渶澶у叕鍥犳暟銆傝繖绉嶆柟娉曞浜庤緝灏忕殑鏁板彲浠ヤ娇鐢紝瀵逛簬杈冨ぇ鐨勬暟鏉ヨ涓嶆槸寰堟柟渚裤傛渶澶у叕鍥犳暟 涔熺О鏈澶у叕绾︽暟銆鏈澶у叕鍥犲瓙锛屾寚涓や釜鎴栧涓暣鏁板叡鏈夌害鏁...
绛旓細鍏洜鏁帮紝涔熺О涓哄叕绾︽暟锛屾槸鎸囪兘澶熷悓鏃舵暣闄や袱涓垨澶氫釜鏁存暟鐨勬暣鏁般備緥濡傦紝12鍜18鐨勫叕鍥犳暟鏈1銆2銆3鍜6锛屽叾涓渶澶х殑鍏洜鏁版槸6锛屼篃鍙仛鏈澶у叕绾︽暟銆1銆佸垪涓炬硶 灏辨槸鎶婃瘡涓暟鐨勬墍鏈夋鍥犳暟閮藉垪鍑烘潵锛岀劧鍚庢壘鍑哄畠浠叡鏈夌殑鍥犳暟銆傝繖绉嶆柟娉曠畝鍗曠洿瑙傦紝浣嗘槸褰撴暟杈冨ぇ鏃讹紝鍒椾妇鎵鏈夊洜鏁颁細姣旇緝楹荤儲銆備緥濡傦紝姹24鍜36...
绛旓細1銆佸垎瑙h川鍥犳暟娉曪細棣栧厛灏嗗嚑涓暟鍒嗚В鎴愯嫢骞蹭釜璐ㄥ洜鏁扮殑涔樼Н褰㈠紡锛岀劧鍚庢壘鍑鸿繖浜涜川鍥犳暟涓殑鍏叡閮ㄥ垎锛屽皢杩欎簺鍏叡鐨勮川鍥犳暟鐩镐箻锛屽緱鍒扮殑涔樼Н鍗充负杩欏嚑涓暟鐨勬渶澶у叕鍥犳暟銆2銆佺煭闄ゆ硶锛氶噰鐢ㄧ煭闄ゆ硶瀵归渶瑕姹傛渶澶у叕鍥犳暟鐨勬暟杩涜杩炵画闄ゆ硶杩愮畻锛岀洿鍒版棤娉曠户缁暣闄や负姝傚湪姝よ繃绋嬩腑锛屾墍浣跨敤鐨勯櫎鏁板嵆涓哄叕鍥犳暟銆傛渶缁堬紝...
绛旓細1. 鍐欏洜鏁版硶锛氶鍏堝垪鍑烘瘡涓暟鐨勫洜鏁帮紝鐒跺悗鎵惧嚭瀹冧滑鍏辨湁鐨勫洜鏁帮紝杩欎簺鍏辨湁鍥犳暟涓殑鏈澶у煎嵆涓烘墍姹傜殑鏈澶у叕鍥犳暟銆傝繖鏄渶鍩烘湰鐨勬眰瑙f柟娉曘2. 鍥惧舰娉曪細鍒楀嚭鏁扮殑鍏湁鍥犳暟锛岄殢鍚庡垎鍒垪鍑烘瘡涓暟鐨勫洜鏁般3. 鍒嗚В璐ㄥ洜鏁版硶锛氬姣忎釜鏁板垎鍒垎瑙h川鍥犳暟锛屾壘鍑哄畠浠殑鍏湁璐ㄥ洜鏁般傚鏋滄湁涓や釜鎴栦互涓婄殑鏁帮紝灏嗗叕鏈夎川...
绛旓細鏈澶у叕鍥犳暟 涓銆佸垪涓炬硶锛氬氨鏄妸鍑犱釜鏁扮殑鎵鏈夊洜鏁伴兘鍐欏嚭鏉ワ紝閫氳繃瀵规瘮銆佽瀵熴佹壘鍑哄叕鍥犳暟鈥斺旀渶澶у叕鍥犳暟銆傛眰锛12锛18锛夈12鐨勫洜鏁版湁锛1銆2銆3銆4銆6銆12.18鐨勫洜鏁版湁锛1銆2銆3銆6銆9銆18.12鍜18鐨勫叕鍥犳暟鏈夛細1銆2銆3銆6.锛12锛18锛=6 浜屻佸垎瑙h川鍥犳暟娉曪細灏辨槸灏嗗嚑涓暟鍚勮嚜鍒嗚В鎴愯川鍥犳暟...
绛旓細鎬庢牱姹傛渶澶у叕鍥犳暟濡備笅锛氱涓绉嶆柟娉曟槸鏋氫妇娉曘傛墍璋撴灇涓炬硶锛屽氨鏄皢涓や釜鏁扮殑鍥犳暟鍒嗗埆鍒椾妇鍑烘潵锛屽啀浠庝腑鎵惧埌浠栦滑鐨勫叕鍥犳暟锛屾渶鍚庝粠鍏洜鏁颁腑鎵惧埌鏈澶х殑鍏洜鏁般備緥濡傛眰6銆15鐨勬渶澶у叕鍥犳暟銆6鐨勫洜鏁帮細1銆2銆3銆6銆15鐨勫洜鏁帮細1銆3銆5銆15銆備粬浠殑鍏洜鏁版槸1銆3銆傛墍浠ヤ粬浠殑鏈澶у叕鍥犳暟鏄3銆傜浜岀鏂规硶鏄...
绛旓細鐨勬渶澶у叕鍥犳暟鏃 1 ,鏈灏忓叕鍊嶆暟鏄 5 脳 7=35 锛変簩銆佷竴鑸儏鍐碉細1 姹傛渶澶у叕鍥犳暟锛氬垪涓炬硶銆佸崟鍒椾妇娉曘佸垎瑙h川鍥犳暟娉曘佺煭闄ゆ硶銆侀櫎娉曠畻寮忔硶.鈶 鍒椾妇娉 锛氬,姹 18 鍜 27 鐨勬渶澶у叕鍥犳暟 鍏堟壘鍑轰袱涓暟鐨勬墍鏈夊洜鏁 18 鐨勫洜鏁版湁锛1 銆2 銆3 銆6 銆9 銆18 27 鐨勫洜鏁版湁锛1 銆3 銆9 銆27 ...
绛旓細姹傛渶澶у叕绾︽暟鏈夊绉嶆柟娉曪紝甯歌鐨勬湁璐ㄥ洜鏁板垎瑙f硶銆佺煭闄ゆ硶銆佽緱杞浉闄ゆ硶銆佹洿鐩稿噺鎹熸硶銆傛眰鏈澶у叕绾︽暟涓昏鏈夊垎瑙h川鍥犳暟娉曘佸叕寮忔硶銆備竴銆鏈澶у叕鍥犳暟姹傛硶 1銆佽川鍥犳暟鍒嗚В娉 璐ㄥ洜鏁板垎瑙f硶锛氭妸姣忎釜鏁板垎鍒垎瑙h川鍥犳暟锛屽啀鎶婂悇鏁颁腑鐨勫叏閮ㄥ叕鏈夎川鍥犳暟鎻愬彇鍑烘潵杩炰箻锛屾墍寰楃殑绉氨鏄繖鍑犱釜鏁扮殑鏈澶у叕绾︽暟銆備緥濡傦細...
绛旓細1. 鍒椾妇娉 棣栧厛锛屾壘鍑6鐨勫洜鏁帮細1銆2銆3銆6銆傛帴鐫锛屾壘鍑9鐨勫洜鏁帮細1銆3銆9銆傚湪杩欎袱涓垪琛ㄤ腑锛屽叡鍚岀殑鍥犳暟鏈1鍜3锛屽洜姝6鍜9鐨鏈澶у叕鍥犳暟鏄3銆2. 绛涢夋硶 鍒楀嚭6鐨勫洜鏁帮細1銆2銆3銆6锛屽苟浠庝腑绛涢夊嚭鍚屾椂涔熸槸9鐨勫洜鏁扮殑鏁板瓧锛屽嵆1鍜3銆傚洜姝わ紝6鍜9鐨勬渶澶у叕鍥犳暟鏄3銆3. 鍒嗚В鍏洜鏁版硶 灏6鍒嗚В...
绛旓細鍏朵腑1锛2, 4涔熸槸12鐨勫洜鏁般8鍜12鐨勫叕鍥犳暟鏈1, 2锛4锛屽叾涓渶澶х殑鏄4銆2銆佽緱杞浉闄ゆ硶锛堟鍑犻噷寰楃畻娉曪級杈楄浆鐩搁櫎娉曟槸鍏堢敤涓や釜鏁颁腑杈冨ぇ鐨勬暟闄や互杈冨皬鐨勬暟锛屽鏋滄湁浣欐暟锛屽垯鐢ㄨ緝灏忕殑閭d釜鏁扮户缁櫎浠ヤ綑鏁帮紝鎸夌収杩欐牱鐨勬柟娉曚竴鐩撮櫎涓嬪幓锛岄櫎鍒颁綑鏁颁负0涓烘锛岄偅涔堟渶鍚庣殑闄ゆ暟灏辨槸涓や釜鏁扮殑鏈澶у叕鍥犳暟銆傚嶆暟鍜...