【文章內(nèi)容簡介】
、更相減損之術(shù) 等值算法 運算次數(shù) 求x,y的最大公約數(shù) 略解: Read n ,a For i=2 to n Read b If ab then m=a:a=b:b=m Do r=mod(a,b) a=b:b=r Loop Until r=0 If a=1 then prind a Goto End Next i Print a End] INPUT m,n (當型) r=m/n的余數(shù) WHILE r ≠0 m=n n=r r=m/n的余數(shù) [] WEND PRINT n END (直到型) INPUT m,n DO r=m/n的余數(shù) m=n n=r LOOP UNTIL r=