AM电脑吧 - Win10精简版系统_Win11精简版_Win7旗舰版

Yes
查看: 6141|回复: 0
收起左侧

[其它] 物种多样性源代码

[复制链接]
ampc816

签到天数: 303 天

[LV.8]八秒开机

id 绝恋 发表于 2011-08-05 18:39:16
没事写了这个东西!!~~




VERSION 5.00
Begin VB.Form Form1
   Caption         =   "物种多样性"
   ClientHeight    =   3330
   ClientLeft      =   120
   ClientTop       =   450
   ClientWidth     =   4890
   Icon            =   "Form1.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   3330
   ScaleWidth      =   4890
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command3
      Caption         =   "样方法"
      Height          =   735
      Left            =   600
      TabIndex        =   2
      Top             =   1920
      Width           =   3735
   End
   Begin VB.CommandButton Command2
      Caption         =   "辛普森指数2(/)"
      Height          =   615
      Left            =   600
      TabIndex        =   1
      Top             =   1320
      Width           =   3735
   End
   Begin VB.CommandButton Command1
      Caption         =   "辛普森指数1(-)"
      Height          =   855
      Left            =   600
      TabIndex        =   0
      Top             =   480
      Width           =   3735
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim a, mu, b, zi
Private Sub Command1_Click()
    On Error Resume Next
    b = 1
    mu = 0
     a = InputBox("请输入物种数量")
    For i = 1 To a
        b = InputBox("请输入第" & i & "种生物")
        mu = mu + b
        zi = zi + b ^ 2
    Next i
    mu = mu ^ 2
    zhi = 1 - (zi / mu)
    MsgBox "值为:0" & zhi
    MsgBox "e=" & zi & "/" & mu
End Sub
Private Sub Command2_Click()
    On Error Resume Next
    b = 1
    mu = 0
    a = InputBox("请输入物种数量")
    For i = 1 To a
        b = InputBox("请输入第" & i & "种生物")
        mu = mu + b
        zi = zi + b ^ 2
    Next i
    mu = mu ^ 2
    zhi = 1 / (zi / mu)
    MsgBox "e=" & zi & "/" & mu
    MsgBox "值为:0" & zhi
End Sub
Private Sub Command3_Click()
    a = InputBox("请输入有标记数量")
    b = InputBox("请输入捕获总量")
    c = InputBox("输入总标记量")
    MsgBox ("值为:" & a * b / c)
End Sub

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?验证注册

x

本文地址: https://www.ampc8.com/thread-2874-1-1.html
上一篇:电脑主板工作信号名词解释之RTCRST# BATOK# SYSRST#
下一篇:Windows7去除快捷方式小箭头+源码
回复

举报

您需要登录后才可以回帖 登录 | 验证注册

Powered by AMpc8.Com (晋ICP备13003365号ghs 晋公网安备 14090202000112号 |GMT+8, 2025/5/1 03:56 | A
快速回复 返回顶部 返回列表