| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 8404 人关注过本帖, 1 人收藏
标题:这个倒序和蝶形算法vb程序如何运行?
只看楼主 加入收藏
ysr2857
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:34
帖 子:809
专家分:77
注 册:2020-2-10
收藏
得分:0 
程序结果不对,可能是蝶形运算程序不对,请参考下面图片中的内容:(都是vc程序咱不懂)
图片附件: 游客没有浏览图片的权限,请 登录注册
图片附件: 游客没有浏览图片的权限,请 登录注册
图片附件: 游客没有浏览图片的权限,请 登录注册
2021-02-08 22:59
ysr2857
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:34
帖 子:809
专家分:77
注 册:2020-2-10
收藏
得分:0 
如下图片为傅里叶变换和逆变换的原理,如何用蝶形运算快速实现呢?
图片附件: 游客没有浏览图片的权限,请 登录注册
图片附件: 游客没有浏览图片的权限,请 登录注册
图片附件: 游客没有浏览图片的权限,请 登录注册
2021-02-21 21:38
ysr2857
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:34
帖 子:809
专家分:77
注 册:2020-2-10
收藏
得分:0 
这个结果对,但不节约时间:text1=80607000时,结果为:  21+0i  12.9497474683058+-10.9497474683058i  2.00000000000001+-7.00000000000002i  3.05025253169415+1.05025253169416i  7+1.61554255216634E-14i  3.0502525316942+-1.05025253169419i  1.99999999999997+6.99999999999994i  12.9497474683057+10.9497474683059i
代码如下:

Private Sub Command1_Click() '蝶形运算程序
Dim xr() As Double, a As String
 a = Trim(Text1)
 ReDim xr(0 To Len(a) - 1)
 For i1 = 0 To Len(a) - 1
 xr(i1) = Mid(a, i1 + 1, 1)
   Next
 Dim l As Long, le As Long, le1 As Long, n As Long, r As Long, p As Long, q As Long, m As Byte
 Dim wr As Double, w1 As Double, wlr As Double, wl1 As Double, tr As Double, t1 As Double
 Dim pi As Double, t As Double
 Dim xi()
 Dim yr(), yi()

 n = Len(a) '求数组大小,其值必须是2的幂
m = 0
 l = 2
 pi = 3.14159265358979
 Do
 l = l + l
 m = m + 1
 Loop Until l > n
 n = l / 2
 ReDim xi(n - 1)
 ReDim yr(n - 1): ReDim yi(n - 1)

 l = 1
 For i1 = 0 To Len(a) - 1
  tr1 = xr(0) * Cos(0): ti1 = xr(0) * Sin(0)
  tr2 = xr(4) * Cos((-2 * pi / 8) * i1): ti2 = xr(4) * Sin((-2 * pi / 8) * i1)
  tr3 = xr(2) * Cos((-2 * pi / 8) * i1 * 2): ti3 = xr(2) * Sin((-2 * pi / 8) * i1 * 2)
  yr(i1) = tr1 + tr2 + tr3: yi(i1) = ti1 + ti2 + ti3
  Next
  
 Do
   le = 2 ^ l
   le1 = le / 2
   wr = 1
   wi = 0
   t = pi / le1
   w1r = Cos(t)
   w1i = -Sin(t)
   Print l
   r = 0
 Do
   p = r
   Do
    q = p + le1
   
    tr = xr(q) * wr - xi(q) * wi
    ti = xr(q) * wi + xi(q) * wr
   
    xr(q) = xr(p) - tr
    xi(q) = xi(p) - ti
    xr(p) = xr(p) + tr
    xi(p) = xi(p) + ti
    Print p, q
   
    Print xr(p); xi(p); le1, xr(q); xi(q); le1
   
   
    p = p + le
 Loop Until p > n - 2



 wr = wr * w1r - wi * w1i
 wi = wr * w1i + wi * w1r
 r = r + 1
 Loop Until r > le1 - 1
 l = l + 1
 Loop Until l > m

 For i = 0 To n - 1 '仅输出模
Print xr(i), xi(i)
    Text2 = Text2 & "  " & yr(i) & "+" & yi(i) & "i"
    Next

 End Sub

 Private Sub Command2_Click()
 Text1 = ""
 Text2 = ""
 End Sub
2021-02-26 09:46
ysr2857
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:34
帖 子:809
专家分:77
注 册:2020-2-10
收藏
得分:0 
程序弄不对,改进了一下,如下是结果和代码以及原理图片:
Text1=80607000,结果为: 8+16i  -1.29610059419054+-0.372221061679249i  3.05025253169417+8.70710678118656i  1.532843272421+4.59431073134172i  8+0i  1+-2.21998012670182i  8+-2.60660171779821i  8+-1.52862418649973i.
代码如下:

Private Sub Command1_Click() '蝶形运算程序
Dim xr() As Double, a As String
a = Trim(Text1)
ReDim xr(0 To Len(a) - 1)
For i1 = 0 To Len(a) - 1
xr(i1) = Mid(a, i1 + 1, 1)
  Next
Dim l As Long, le As Long, le1 As Long, n As Long, r As Long, p As Long, q As Long, m As Byte
Dim wr As Double, w1 As Double, wlr As Double, wl1 As Double, tr As Double, t1 As Double
Dim pi As Double, t As Double
Dim xi()
n = Len(a) '求数组大小,其值必须是2的幂
m = 0
l = 2
pi = 3.14159265358979
Do
l = l + l
m = m + 1
Loop Until l > n
n = l / 2
ReDim xi(n - 1)

l = 1
Do
  le = 2 ^ l
  le1 = le / 2
  wr = 1
  wi = 0
  t = pi / le1
  w1r = Cos(t)
  w1i = -Sin(t)
  Print l
  r = 0
Do
  p = r
  Do
   q = p + le1
   
   tr = xr(q) * wr - xi(q) * wi
   ti = xr(q) * wi + xi(q) * wr
   m1 = (p + Len(a) / 2) Mod Len(a)
   xr(p) = xr(p) + xr(m1) * Sin((-2 * pi / Len(a)) * r * 2 ^ (m - le1))
 xr(q) = xr(p) - xr(m1) * Sin((-2 * pi / Len(a)) * r * 2 ^ (m - le1))
   xi(p) = xr(p) + xr(m1) * Cos((-2 * pi / Len(a)) * r * 2 ^ (m - le1))
   xi(q) = xr(p) - xr(m1) * Cos((-2 * pi / Len(a)) * r * 2 ^ (m - le1))
   
   Print p, q
   
   Print xr(p); xi(p); le1, xr(q); xi(q); le1
   
   
   p = p + le
Loop Until p > n - 2

wr = wr * w1r - wi * w1i
wi = wr * w1i + wi * w1r
r = r + 1
Loop Until r > le1 - 1
l = l + 1
Loop Until l > m

For i = 0 To n - 1 '仅输出模
Print xr(i), xi(i)
   Text2 = Text2 & "  " & xr(i) & "+" & xi(i) & "i"
   Next

End Sub

Private Sub Command2_Click()
Text1 = ""
Text2 = ""
End Sub

原理图片:
图片附件: 游客没有浏览图片的权限,请 登录注册
图片附件: 游客没有浏览图片的权限,请 登录注册
图片附件: 游客没有浏览图片的权限,请 登录注册
2021-02-28 08:50
ysr2857
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:34
帖 子:809
专家分:77
注 册:2020-2-10
收藏
得分:0 
图片中的-j应该是-i吧?网上的东西胡写八道,怎么就弄对了?
2021-02-28 09:23
ysr2857
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:34
帖 子:809
专家分:77
注 册:2020-2-10
收藏
得分:0 
改了一下程序,仍然不对,下面是结果和代码:
输入:Text1=80607000,结果: 21+0i  14.467156727579+-8.67878402655563i  6.94974746830584+-4.94974746830583i  10.6787840265556+-0.467156727579004i  7+0i  1.532843272421+-3.32121597344437i  -2.94974746830584+4.94974746830583i  5.32121597344435+12.467156727579i.
代码如下:

Private Sub Command1_Click() '蝶形运算程序
Dim xr() As Double, a As String
a = Trim(Text1)
ReDim xr(0 To Len(a) - 1)
For i1 = 0 To Len(a) - 1
xr(i1) = Mid(a, i1 + 1, 1)
  Next
Dim l As Long, le As Long, le1 As Long, n As Long, r As Long, p As Long, q As Long, m As Byte
Dim wr As Double, w1 As Double, wlr As Double, wl1 As Double, tr As Double, t1 As Double
Dim pi As Double, t As Double
Dim xi()
n = Len(a) '求数组大小,其值必须是2的幂
m = 0
l = 2
pi = 3.14159265358979
Do
l = l + l
m = m + 1
Loop Until l > n
n = l / 2
ReDim xi(n - 1)

l = 1
Do
  le = 2 ^ l
  le1 = le / 2
  wr = 1
  wi = 0
  t = pi / le1
  w1r = Cos(t)
  w1i = -Sin(t)
  Print l
  r = 0
Do
  p = r
  Do
   q = p + le1
   
   tr = xr(q) * Cos((-2 * pi / 2 ^ le1) * r)
   ti = xr(q) * Sin((-2 * pi / 2 ^ le1) * r)
   
   xr(q) = xr(p) - tr
   xi(q) = xi(p) - ti
   xr(p) = xr(p) + tr
   xi(p) = xi(p) + ti
   Print p, q
   
   Print xr(p); xi(p); r, xr(q); xi(q); r
   
   
   p = p + le
Loop Until p > n - 2

wr = wr * w1r - wi * w1i
wi = wr * w1i + wi * w1r
r = r + 1
Loop Until r > le1 - 1
l = l + 1
Loop Until l > m

For i = 0 To n - 1 '仅输出模
Print xr(i), xi(i)
   Text2 = Text2 & "  " & xr(i) & "+" & xi(i) & "i"
   Next

End Sub

Private Sub Command2_Click()
Text1 = ""
Text2 = ""
End Sub

2021-03-02 00:22
ysr2857
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:34
帖 子:809
专家分:77
注 册:2020-2-10
收藏
得分:0 
又改了一下程序,仍然不对,下面是结果和代码:
 输入:Text1=80607000,结果:  21+0i  8.86549696282261+-1.36563225411292i  8.46715672757901+-2.67878402655563i  19.8202872861178+-3.88899163113719i  7+0i  -4.86549696282261+1.36563225411288i  -4.46715672757901+2.67878402655563i  8.17971271388218+3.88899163113723i代码如下:

Private Sub Command1_Click() '蝶形运算程序
Dim xr() As Double, a As String
 a = Trim(Text1)
 ReDim xr(0 To Len(a) - 1)
 For i1 = 0 To Len(a) - 1
 xr(i1) = Mid(a, i1 + 1, 1)
   Next
 Dim l As Long, le As Long, le1 As Long, n As Long, r As Long, p As Long, q As Long, m As Byte
 Dim wr As Double, w1 As Double, wlr As Double, wl1 As Double, tr As Double, t1 As Double
 Dim pi As Double, t As Double
 Dim xi()
 n = Len(a) '求数组大小,其值必须是2的幂
m = 0
 l = 2
 pi = 3.14159265358979
 Do
 l = l + l
 m = m + 1
 Loop Until l > n
 n = l / 2
 ReDim xi(n - 1)

 l = 1
 Do
   le = 2 ^ l
   le1 = le / 2
   wr = 1
   wi = 0
   t = pi / le1
   w1r = Cos(t)
   w1i = -Sin(t)
   Print l
   r = 0
 Do
   p = r
   Do
    q = p + le1
   
    tr = xr(q) * Cos((-2 * pi / 2 ^ le1) * r * 2 ^ (m - le1))
    ti = xr(q) * Sin((-2 * pi / 2 ^ le1) * r * 2 ^ (m - le1))
   
    xr(q) = xr(p) - tr
    xi(q) = xi(p) - ti
    xr(p) = xr(p) + tr
    xi(p) = xi(p) + ti
    Print p, q
   
    Print xr(p); xi(p); r, xr(q); xi(q); r
   
   
    p = p + le
 Loop Until p > n - 2


 r = r + 1
 Loop Until r > le1 - 1
 l = l + 1
 Loop Until l > m

 For i = 0 To n - 1 '仅输出模
Print xr(i), xi(i)
    Text2 = Text2 & "  " & xr(i) & "+" & xi(i) & "i"
    Next

 End Sub

 Private Sub Command2_Click()
 Text1 = ""
 Text2 = ""
 End Sub
2021-03-02 00:40
ysr2857
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:34
帖 子:809
专家分:77
注 册:2020-2-10
收藏
得分:0 
哈哈哈!这回可能蒙对了,太激动了!!
 如下是结果和程序代码:
 输入:Text1=80607000,结果: 21+0i  12.9497474683058+-10.9497474683058i  2.00000000000001+-7i  3.05025253169417+1.05025253169416i  7+0i  3.05025253169417+-1.05025253169417i  1.99999999999999+7i  12.9497474683058+10.9497474683058i.

代码如下:

Private Sub Command1_Click() '蝶形运算程序
Dim xr() As Double, a As String
a = Trim(Text1)
ReDim xr(0 To Len(a) - 1)
For i1 = 0 To Len(a) - 1
xr(i1) = Mid(a, i1 + 1, 1)
  Next
Dim l As Long, le As Long, le1 As Long, n As Long, r As Long, p As Long, q As Long, m As Byte
Dim wr As Double, w1 As Double, wlr As Double, wl1 As Double, tr As Double, t1 As Double
Dim pi As Double, t As Double
Dim xi()
n = Len(a) '求数组大小,其值必须是2的幂
m = 0
l = 2
pi = 3.14159265358979
Do
l = l + l
m = m + 1
Loop Until l > n
n = l / 2
ReDim xi(n - 1)

l = 1
Do
  le = 2 ^ l
  le1 = le / 2
  Print l
  r = 0
Do
  p = r
  Do
   q = p + le1
   
   tr = xr(q) * Cos((-2 * pi / 2 ^ l) * r)
   ti = xr(q) * Sin((-2 * pi / 2 ^ l) * r)
   
   xr(q) = xr(p) - tr
   xi(q) = xi(p) - ti
   xr(p) = xr(p) + tr
   xi(p) = xi(p) + ti
   Print p, q
   
   Print xr(p); xi(p); r, xr(q); xi(q); r
   
   
   p = p + le
Loop Until p > n - 2


r = r + 1
Loop Until r > le1 - 1
l = l + 1
Loop Until l > m

For i = 0 To n - 1 '仅输出模
Print xr(i), xi(i)
   Text2 = Text2 & "  " & xr(i) & "+" & xi(i) & "i"
   Next

End Sub

Private Sub Command2_Click()
Text1 = ""
Text2 = ""
End Sub


明天再说!!

[此贴子已经被作者于2021-3-2 01:14编辑过]

2021-03-02 00:52
ysr2857
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:34
帖 子:809
专家分:77
注 册:2020-2-10
收藏
得分:0 
倒序程序修改了一下就正确了:
输入:Text1=00000678,结果:80607000.
输入:Text1=00000432,结果:20403000.

代码如下:
Private Sub Command1_Click()
 Dim x_() As Double, a As String
 a = Trim(Text1)
 ReDim x_(1 To Len(a))
 For i1 = 1 To Len(a)
 x_(i1) = Mid(a, Len(a) - i1 + 1, 1)
   Next
 Dim n As Integer, i As Long, j As Long, mn As Long, lh As Long, t As Double, k As Long
 '位序倒置
n = Len(a) '求数组大小,其值必须是2的幂
lh = n / 2
 j = n / 2
 For i = 1 To n - 2


 Debug.Print i, j
 k = lh '下面是向右进位算法
Do
 If k > j Then Exit Do '高位是1吗
j = j - k '是的,高位置0
 k = k / 2 '准备次高位的权
Loop Until k = 0 '次高位的权若非0,则检查新的次高位
j = j + k '非则若最高位是0,则置1
 Text2 = Text2 & x_(j + 1)
 Next
 Text2 = x_(1) & x_(1 + Len(a) / 2) & Text2
 
 End Sub

 Private Sub Command2_Click()
 Text1 = ""
 Text2 = ""
 End Sub
2021-03-02 06:43
ysr2857
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:34
帖 子:809
专家分:77
注 册:2020-2-10
收藏
得分:0 
又不对了困难了,啊啊!
输入:Text1 =80607000,Text2=20403000,结果:
/29/65/34/24/10/2/11/16
与正确值比较:0, 0, 0, 0, 24, 46, 65, 38, 16也是不对。

Private Sub Command1_Click()
Dim xr() As Double, a As String
a = Trim(Text1)
b = Trim(Text3)
sb1 = Len(a) + Len(b)
sb2 = Log(sb1) / Log(2)
If InStr(sb2, ".") = 0 Then
sb2 = sb2
Else
sb2 = Int(sb2) + 1
End If
sb = 2 ^ sb2
Print sb
ReDim xr(0 To Len(a) - 1): ReDim yr(0 To Len(b) - 1): ReDim zr(0 To Len(b) - 1)
For i1 = 0 To Len(a) - 1
xr(i1) = Mid(a, i1 + 1, 1)
yr(i1) = Mid(b, i1 + 1, 1)

  Next
Dim l As Long, le As Long, le1 As Long, n As Long, r As Long, p As Long, q As Long, m As Byte
Dim wr As Double, w1 As Double, wlr As Double, wl1 As Double, tr As Double, t1 As Double
Dim pi As Double, t As Double, tr1 As Double
Dim xi(): Dim yi(): Dim zi()
n = Len(a) '求数组大小,其值必须是2的幂
m = 0
l = 2
pi = 3.14159265358979
Do
l = l + l
m = m + 1
Loop Until l > n
n = l / 2
ReDim xi(n - 1): ReDim yi(n - 1): ReDim zi(n - 1)

l = 1
Do
  le = 2 ^ l
  le1 = le / 2
 
  r = 0
Do
  p = r
  Do
   q = p + le1
   
   tr = xr(q) * Cos((-2 * pi / 2 ^ l) * r)
   ti = xr(q) * Sin((-2 * pi / 2 ^ l) * r)
   
   tr1 = yr(q) * Cos((-2 * pi / 2 ^ l) * r)
   ti1 = yr(q) * Sin((-2 * pi / 2 ^ l) * r)
   
   xr(q) = xr(p) - tr
   xi(q) = xi(p) - ti
   xr(p) = xr(p) + tr
   xi(p) = xi(p) + ti
   
    yr(q) = yr(p) - tr1
   yi(q) = yi(p) - ti1
   yr(p) = yr(p) + tr1
   yi(p) = yi(p) + ti1
   
   p = p + le
Loop Until p > n - 1


r = r + 1
Loop Until r > le1 - 1
l = l + 1
Loop Until l > m

For i = 0 To n - 1 '仅输出模
   zr(i) = xr(i) * yr(i) - xi(i) * yi(i): zi(i) = xr(i) * yi(i) + xi(i) * yr(i)
   If InStr(zr(i), ".") = 0 Then
   zr(i) = zr(i)
   Else
   a1 = Left(zr(i), InStr(zr(i), ".") - 1)
   b1 = Mid(zr(i), InStr(zr(i), "."), 3)
   zr(i) = a1 & b1
   End If
   If InStr(zi(i), ".") = 0 Then
   zi(i) = zi(i)
   Else
   a2 = Left(zi(i), InStr(zi(i), ".") - 1)
   b2 = Mid(zi(i), InStr(zi(i), "."), 3)
   zi(i) = a2 & b2
   End If
   s = s & "/" & zr(i)
   s1 = s1 & "/" & zi(i)
   Next
  s2 = nifft(dxcx1(Trim(s)), dxcx1(Trim(s1)))
   Text2 = s2
End Sub

Private Sub Command2_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Form1.Cls
End Sub

Private Function dxcx0(sa As String, sb As String) As String

Dim x_() As Double, a As String
 a = Trim(sa)
 ReDim x_(1 To sb)
 For i1 = 1 To sb
 x_(i1) = Mid(a, sb - i1 + 1, 1)
   Next
 Dim n As Integer, i As Long, j As Long, mn As Long, lh As Long, t As Double, k As Long
 '位序倒置
n = sb '求数组大小,其值必须是2的幂
lh = n / 2
 j = n / 2
 For i = 1 To n - 2


 Debug.Print i, j
 k = lh '下面是向右进位算法
Do
 If k > j Then Exit Do '高位是1吗
j = j - k '是的,高位置0
 k = k / 2 '准备次高位的权
Loop Until k = 0 '次高位的权若非0,则检查新的次高位
j = j + k '非则若最高位是0,则置1
 s = s & x_(j + 1)
 Next
 dxcx0 = x_(1) & x_(1 + sb / 2) & s
 

End Function

Private Function nifft(sa As String, sb As String) As String
Dim l As Long, le As Long, le1 As Long, j As Long, r As Long, p As Long, q As Long, m As Byte
Dim wr As Double, w1 As Double, wlr As Double, wl1 As Double, tr As Double, t1 As Double
Dim pi As Double, t As Double, tr1 As Double
Dim xi(): Dim yi(): Dim zi()
Dim xr(), yr(), zr()
s2 = Split(sa, "/")
s3 = Split(sb, "/")
   j = UBound(s2)
   n = j
  For k = 1 To j
      n1 = n1 + 1
       ReDim Preserve xr(0 To n1 - 1)
       ReDim Preserve yr(0 To n1 - 1)
      xr(n1 - 1) = s2(n1): yr(n1 - 1) = s3(n1)
    Next
   

ReDim zr(0 To n - 1)

m = 0
l = 2
pi = 3.14159265358979
Do
l = l + l
m = m + 1
Loop Until l > n
n = l / 2
ReDim xi(n - 1): ReDim yi(n - 1): ReDim zi(n - 1)

l = 1
Do
  le = 2 ^ l
  le1 = le / 2
  
  r = 0
Do
  p = r
  Do
   q = p + le1
   
   tr = xr(q) * Cos((-2 * pi / 2 ^ l) * r)
   ti = xr(q) * Sin((-2 * pi / 2 ^ l) * r)
   
   tr1 = yr(q) * Cos((-2 * pi / 2 ^ l) * r)
   ti1 = yr(q) * Sin((-2 * pi / 2 ^ l) * r)
   
   xr(q) = xr(p) - tr
   xi(q) = xi(p) - ti
   xr(p) = xr(p) + tr
   xi(p) = xi(p) + ti
   
    yr(q) = yr(p) - tr1
   yi(q) = yi(p) - ti1
   yr(p) = yr(p) + tr1
   yi(p) = yi(p) + ti1
   
   p = p + le
Loop Until p > n - 1


r = r + 1
Loop Until r > le1 - 1
l = l + 1
Loop Until l > m

For i = 0 To n - 1 '仅输出模
zr(i) = (xr(i) - yi(i)) / n
   If InStr(zr(i), ".") = 0 Then
   zr(i) = zr(i)
   Else
   a1 = Left(zr(i), InStr(zr(i), ".") - 1)
   b1 = Mid(zr(i), InStr(zr(i), "."), 3)
   zr(i) = a1 & b1
   End If
   
   s1 = Int(Val(zr(i) + 0.5))
   s = "/" & s1 & s
   Next
   
   
nifft = s

End Function


Private Function dxcx1(sa As String) As String

Dim x_() As Double, a As String
 a = Trim(sa)
   

s2 = Split(sa, "/")

   j = UBound(s2)
   sb = j
   
    ReDim x_(1 To sb)
  For k = 1 To j
      n1 = n1 + 1
       ReDim Preserve x_(1 To n1)
      
      x_(n1) = s2(n1)
    Next
 Dim n As Integer, i As Long, mn As Long, lh As Long, t As Double
 '位序倒置
n = sb '求数组大小,其值必须是2的幂
lh = n / 2
 j = n / 2
 For i = 1 To n - 2


 Debug.Print i, j
 k = lh '下面是向右进位算法
Do
 If k > j Then Exit Do '高位是1吗
j = j - k '是的,高位置0
 k = k / 2 '准备次高位的权
Loop Until k = 0 '次高位的权若非0,则检查新的次高位
j = j + k '非则若最高位是0,则置1
 s = s & "/" & x_(j + 1)
 Next
 dxcx1 = "/" & x_(1) & "/" & x_(1 + sb / 2) & s
 
 End Function

2021-03-02 22:14
快速回复:这个倒序和蝶形算法vb程序如何运行?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.041975 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved