Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 C# 中有以下循环
for (int i = 0; i <= n; d[i, 0] = i++) {}
这是我使用但不清楚(离题)的 levenshtein 算法的一部分,我需要将此行翻译成 vb.net。似乎无法确定我需要使用两个循环中的哪一个:
for i as integer to n step 1 d(i,0) = i next
或者
for i as integer to n step 1 d(i,0) = i +1 next
这将是:
For i As Integer 0 To n d(i,0) = i Next
在d[i, 0] = i++,d[i, 0]获取它i 之前的值,所以 VB 循环应该做同样的事情。
d[i, 0] = i++
d[i, 0]
i
这是等效的 VB.NET 代码:
For i As Integer = 0 To n d(i,0) = i Next