VB 这个代码怎么样简写If i y(0) And i y(0) + 1 And i y(0) - 1 And j y(1) And j y(1) + 1 And j y(1) - 1 And k y(2) And k y(2) + 1 And k y(2) - 1 And _Abs(i - j) > 1 And Abs(i - k) > 1 And Abs(j - k) > 1 Then后面abs就不用了,前面的有
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/01 07:01:59
VB 这个代码怎么样简写If i y(0) And i y(0) + 1 And i y(0) - 1 And j y(1) And j y(1) + 1 And j y(1) - 1 And k y(2) And k y(2) + 1 And k y(2) - 1 And _Abs(i - j) > 1 And Abs(i - k) > 1 And Abs(j - k) > 1 Then后面abs就不用了,前面的有
VB 这个代码怎么样简写
If i y(0) And i y(0) + 1 And i y(0) - 1 And j y(1) And j y(1) + 1 And j y(1) - 1 And k y(2) And k y(2) + 1 And k y(2) - 1 And _
Abs(i - j) > 1 And Abs(i - k) > 1 And Abs(j - k) > 1 Then
后面abs就不用了,前面的有没有办法简写一下,老觉得代码太长而且繁琐
VB 这个代码怎么样简写If i y(0) And i y(0) + 1 And i y(0) - 1 And j y(1) And j y(1) + 1 And j y(1) - 1 And k y(2) And k y(2) + 1 And k y(2) - 1 And _Abs(i - j) > 1 And Abs(i - k) > 1 And Abs(j - k) > 1 Then后面abs就不用了,前面的有
既然后边都会用abs了,为何前边不用.
iy(0)相当于i-y(0)0
iy(0)+-1相当于i-y(0)+-1
如果i和y(0)都是integer,那么可以这样写abs(i-y(0))>1
以此类推j,k