| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3299 人关注过本帖
标题:在VB语言中如何采用数组的形势编写出来?
只看楼主 加入收藏
sr88csg
Rank: 1
等 级:新手上路
帖 子:32
专家分:0
注 册:2016-1-7
收藏
得分:0 
又错了,谢谢版主
2016-01-07 16:12
sr88csg
Rank: 1
等 级:新手上路
帖 子:32
专家分:0
注 册:2016-1-7
收藏
得分:0 
谢谢4楼的高手
2016-01-07 16:14
sr88csg
Rank: 1
等 级:新手上路
帖 子:32
专家分:0
注 册:2016-1-7
收藏
得分:0 
谢谢4楼的高手
2016-01-07 16:15
sr88csg
Rank: 1
等 级:新手上路
帖 子:32
专家分:0
注 册:2016-1-7
收藏
得分:0 
竟然没人知道我,只怪我太差了。自己搞去
2016-01-08 11:12
sr88csg
Rank: 1
等 级:新手上路
帖 子:32
专家分:0
注 册:2016-1-7
收藏
得分:0 
Private Sub Command1_Click()

Dim i, j, k As Integer
Dim DB, m As Double
DB = Val(Text1.Text)
m = Val(Text2.Text)


 Dim d
 d = Array(Array(1, 2, 3, 4, 5, 6, 7, 8), Array(9, 10, 11, 12, 13, 14, 15, 16, 17, 18), Array(19, 20, 21, 22, 23, 24, 25, 26))
  
 
 If DB <= 12 Then
   i = 0
   ElseIf DB > 12 And DB <= 25 Then
   i = 1
   ElseIf DB > 25 And DB <= 50 Then
   i = 2
   ElseIf DB > 25 And DB <= 50 Then
   i = 3
   ElseIf DB > 50 And DB <= 100 Then
   i = 4
   ElseIf DB > 100 And DB <= 200 Then
   i = 5
   ElseIf DB > 200 And DB <= 400 Then
   i = 6
   Else: i = 7
   End If
     
If m <= 1.5 Then
   j = 0
ElseIf m > 1.5 And m <= 4 Then
   j = 1
Else
   j = 2
End If
 
 


 Print d(j)(i)

 End Sub

2016-01-08 14:09
sr88csg
Rank: 1
等 级:新手上路
帖 子:32
专家分:0
注 册:2016-1-7
收藏
得分:0 
终于自己搞定了,现在就是要写三维的。
2016-01-08 14:10
sr88csg
Rank: 1
等 级:新手上路
帖 子:32
专家分:0
注 册:2016-1-7
收藏
得分:0 
公差表.rar (42.18 KB)
     我现在的问题是,已知,DB,m,偏差等级  同时满足三个条件才能选到需要的数据。程序怎么编写呢?
2016-01-08 14:29
sr88csg
Rank: 1
等 级:新手上路
帖 子:32
专家分:0
注 册:2016-1-7
收藏
得分:0 
求求高手指教
2016-01-08 14:30
sr88csg
Rank: 1
等 级:新手上路
帖 子:32
专家分:0
注 册:2016-1-7
收藏
得分:0 

 Dim d
 d = Array(Array(200, 180, 160, 140, 125, 110, 100, 90, 80), Array(180, 162, 144, 126, 112, 99, 90, 81, 72), Array(160, 144, 128, 112, 100, 88, 80, 72, 64), Array(140, 126, 112, 98, 88, 77, 70, 63, 56), Array(120, 108, 96, 84, 75, 66, 60, 54, 48), Array(100, 90, 80, 70, 62, 55, 50, 45, 40), Array(80, 72, 64, 56, 50, 44, 40, 36, 32), Array(60, 54, 48, 42, 37, 33, 30, 27, 24), Array(40, 36, 32, 28, 25, 22, 20, 18, 16), Array(20, 18, 16, 14, 12, 11, 10, 9, 8), Array(0, 0, 0, 0, 0, 0, 0, 0, 0), Array(-20, -18, -16, -14, -12, -11, -10, -9, -8), Array(-40, -36, -32, -28, -25, -22, -20, -18, -16), Array(-60, -54, -48, -42, -37, -33, -30, -27, -24), Array(-80, -72, -64, -56, -50, -44, -40, -36, -32), Array(-120, -108, -96, -84, -75, -66, -60, -54, -48), Array(-160, -144, -128, -112, -100, -88, -80, -72, -64), Array(-200, -180, -160, -140, -125, -110, -100, -90, -80))

  If m < 1.5 Then
       If DB <= 12 Then
       i = 8
       ElseIf DB > 12 And DB <= 25 Then
       i = 7
       ElseIf DB > 25 And DB <= 50 Then
       i = 6
       ElseIf DB > 50 And DB <= 100 Then
       i = 5
       ElseIf DB > 100 And DB <= 200 Then
       i = 4
       ElseIf DB > 200 And DB <= 400 Then
       i = 3
       Else: i = 2
       End If
 ElseIf m > 1.5 And m <= 4 Then
       If DB <= 12 Then
       i = 7
       ElseIf DB > 12 And DB <= 25 Then
       i = 6
       ElseIf DB > 25 And DB <= 50 Then
       i = 5
       ElseIf DB > 50 And DB <= 100 Then
       i = 4
       ElseIf DB > 100 And DB <= 200 Then
       i = 3
       ElseIf DB > 200 And DB <= 400 Then
       i = 2
       Else: i = 1
       End If
 Else
      
       If DB <= 12 Then
       i = 6
       ElseIf DB > 12 And DB <= 25 Then
       i = 5
       ElseIf DB > 25 And DB <= 50 Then
       i = 4
       ElseIf DB > 50 And DB <= 100 Then
       i = 3
       ElseIf DB > 100 And DB <= 200 Then
       i = 2
       ElseIf DB > 200 And DB <= 400 Then
       i = 1
       Else: i = 0
       End If
  End If
  
  
  If Pc = "v" Then
  j = 0
  ElseIf Pc = "u" Then
  j = 1
  ElseIf Pc = "t" Then
  j = 2
  ElseIf Pc = "s" Then
  j = 3
  ElseIf Pc = "r" Then
  j = 4
  ElseIf Pc = "p" Then
  j = 5
  ElseIf Pc = "n" Then
  j = 6
  ElseIf Pc = "m" Then
  j = 7
  ElseIf Pc = "k" Then
  j = 8
  ElseIf Pc = "j" Then
  j = 9
  ElseIf Pc = "h" Then
  j = 10
  ElseIf Pc = "g" Then
  j = 11
  ElseIf Pc = "f" Then
  j = 12
  ElseIf Pc = "e" Then
  j = 13
  ElseIf Pc = "d" Then
  j = 14
  ElseIf Pc = "c" Then
  j = 15
  ElseIf Pc = "b" Then
  j = 16
  Else: j = 17
  End If
  
 Print d(j)(i)

 End Sub
2016-01-08 16:02
sr88csg
Rank: 1
等 级:新手上路
帖 子:32
专家分:0
注 册:2016-1-7
收藏
得分:0 
哪里错误了呢,怎么查出来的全是最后一组的数据?
2016-01-08 16:03
快速回复:在VB语言中如何采用数组的形势编写出来?
数据加载中...
 
   



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

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