标题:写到这不会了 ,帮忙看下。
只看楼主
流星1027
Rank: 1
等 级:新手上路
帖 子:6
专家分:8
注 册:2015-9-1
 问题点数:0 回复次数:1 
写到这不会了 ,帮忙看下。
Public Class Form1
    Dim mark(9) As Integer
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim i As Integer
        Randomize()
        Label1.Text = ""
        For i = 1 To 10
            Label1.Text &= Int(Rnd() * 71) + 30 & "  "

        Next
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim b, c, max, min As Integer
        max = mark(0)
        For b = mark(0) To mark(9)
            If mark(b) > mark(0) Then
                max = mark(b)

            End If
        Next
        min = mark(0)
        For c = 0 To 9
            If mark(c) > mark(0) Then
                max = mark(c)

            End If
        Next
        Label3.Text = max
        Label5.Text = min
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

        Dim aver, a As Single
        aver = 0
        For a = mark(0) To mark(9)
            mark(a) &= Int(Rnd() * 71) + 30 & "  "
            aver = aver + mark(a)
        Next
        mark(9) = aver / 10
        Label7.Text = mark(9)

    End Sub
End Class
2015-09-25 21:39
流星1027
Rank: 1
等 级:新手上路
帖 子:6
专家分:8
注 册:2015-9-1
得分:0 

Public Class Form1
    Dim mark(9) As Integer
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim i As Integer
        Randomize()
        Label1.Text = ""
        For i = 0 To 9
            mark(i) = Int(Rnd() * 71) + 30 & "  "
            Label1.Text &= mark(i) & "   "
        Next
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim b, max As Integer
        Dim c, min As Integer
        max = mark(0)
        For b = 0 To 9
            If mark(b) > max Then
                max = mark(b)

            End If
        Next
      
        Label3.Text = max

        min = mark(0)
        For c = 0 To 9
            If mark(c) < min Then
                min = mark(c)

            End If
        Next

        Label5.Text = min
      
    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

        Dim aver, a, p, g As Single


        For a = 0 To 9
            aver = aver + mark(a)
        Next
        p = aver / 10
        For a = 0 To 9
            If mark(a) > p Then g = g + 1

        Next
        Label7.Text = p
        Label9.Text = g


    End Sub

   
End Class
自己附上答案
2015-09-30 22:00



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-457665-1-1.html




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

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