VB输入某班级N个先生的效实到数组X中,寻求效实的

2016-09-25 08:04  来源:未知  编辑:admin  已有( )人围观
导读Private Sub Command1_Click() Dim i As Integer, cj() As Integer, n As Integer, zcj As Integer, pj As S...

  Private Sub Command1_Click()

  Dim i As Integer, cj() As Integer, n As Integer, zcj As Integer, pj As Single, s As Single, q As Single

  n=InputBox("请输入先生人数:")

  ReDim cj(n) As Integer

  For i=1 To n

  cj(i)=InputBox("请输入第 " & i & " 个先见效实:")

  Next

  zcj=0

  For i=1 To n

  zcj=zcj + cj(i)

  Next

  pj=zcj / n

  s=0

  For i=1 To n

  s=s + (cj(i) - pj) ^ 2

  Next

  q=Sqr(s / (n - 1))

  Print q

  End Sub

  规范差公式??????

    阅读此文的人还看了

    bwin官网注册-bwin官网开户|bwin体育官网 网站地图