精品偷拍一区二区三区,亚洲精品永久 码,亚洲综合日韩精品欧美国产,亚洲国产日韩a在线亚洲

  • <center id="usuqs"></center>
  • 
    
  • The Euclidean algorithm is used to find the greatest common divisor (gcd) of two positive integers

    The Euclidean algorithm is used to find the greatest common divisor (gcd) of two positive integers
    (繼續(xù))a and b.
    input (a)
    input (b)
    while b>0
    begin
    r:=a mod b
    a:=b
    b:=r
    end
    gcd:=a
    output(gcd)
    When the algorithm is used to find the greatest common divisor of a =273 and b=110, which of the following is the sequence of computed values for r?
    (A)2,26,1,0
    (B)2,53,1,0
    (C)53,2,1,0
    (D)53,4,1,0
    (E) 53,5,1,0
    選D,怎么做的?
    程序里的":="是什么意思?
    數(shù)學人氣:293 ℃時間:2020-03-29 14:30:31
    優(yōu)質解答
    這是求最大公約數(shù)的算法,在這個程序中":="應該就是賦值號,就是把符號右邊變量的值賦給左邊變量,mod是取余的函數(shù),循環(huán)語句中
    第一次 a=273 ,b=110 ,a/b的余數(shù)r=53
    第二次 a=110 ,b=53 ,r=4
    第三次 a=53 ,b=4 ,r=1
    第四次 a= 4 ,b=1 ,r=0
    因而r 的取值為 D
    我來回答
    類似推薦
    請使用1024x768 IE6.0或更高版本瀏覽器瀏覽本站點,以保證最佳閱讀效果。本頁提供作業(yè)小助手,一起搜作業(yè)以及作業(yè)好幫手最新版!
    版權所有 CopyRight © 2012-2024 作業(yè)小助手 All Rights Reserved. 手機版