| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1967 人关注过本帖
标题:写到这不会了 ,帮忙看下。
只看楼主 加入收藏
流星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
快速回复:写到这不会了 ,帮忙看下。
数据加载中...
 
   



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

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