CLEAR
input "第一个数:" to n1
input "第二个数:" to n2
input "第三个数:" to n3
n=0
lflag=.t.
gy=.t.
DO while lflag
n=n+1
k=MAX(n1,n2,n3)
FOR j=k to 1 step -1
IF INT(n1/j)=n1/j
if INT(n2/j)=n2/j
if INT(n3/j)=n3/j .and.gy
"最大公约数:",j
gy=.f.
EXIT
ENDIF
ENDIF
ENDIF
ENDFOR
IF INT(n/n1)=n/n1 .and.INT(n/n2)=n/n2 .and.INT(n/n3)=n/n3
"最小公倍数:",n
lflag=.f.
ENDIF
ENDDO