Sub swap(a As Variant, b As Variant)
t = a
a = b
b = t
End Sub

解决方案 »

  1.   

    1、Z=X:X=Y:Y=Z
    2、
      if A<B then  
       X=A:A=B:B=X
      end if
      if A<C then
       X=A:A=C:C=X
      end if  
      if B<C then  
       X=B:B=C:C=X
      end if
      

  2.   

    1.
    s=x
    x=y
    y=s
    2.max=a
    if a<b  then
    max=b
    end if
    if max<c then
    max=c
    end if
      

  3.   

    Private Sub Form_Load()
    Me.AutoRedraw = TrueDim a As Long, y As Long, c As Long, t As Longa = 5
    b = 8
    c = 99t = aIf t < b Then swap t, b
    If t < c Then swap t, ca = t
    If b < c Then swap b, cPrint a
    Print b
    Print cEnd SubSub swap(a As Variant, b As Variant)
    t = a
    a = b
    b = t
    End Sub
      

  4.   

    1.x=a
      a=b
      b=x
      

  5.   

    1.
    x=x+y
    y=x-y
    x=x-y