🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.lang.visual-basic
Article #118

Re: ��ţ�ܲ��ܰ�æ������ҵ����

#118
From: һ����ˮ
Date: Sun, 24 Dec 2006 03:45
63 lines
3260 bytes
6-1
�ڴ��������һ������ʽ��Ͽ���������ť�����г���ʱ��������ʽ��Ͽ��м��롰C++ 

������ơ�����Visual Basic ������ơ�����Fortran������ơ�����Photoshop��, 
����
ҳ��ơ�5���ѡ��һ���б���ʱ���ڱ�ǩ������ʾѡ���б������š�

Private Sub Form_Load()
Combo1.AddItem "C++ �������"
Combo1.AddItem "Visual Basic �������"
Combo1.AddItem "Fortran �������"
Combo1.AddItem "Photoshop"
Combo1.AddItem "��ҳ���"
Label1.Caption = ""
Label1.AutoSize = True
End Sub

Private Sub Combo1_Click()
Label1.Caption = "��ѡ���˵�" & Combo1.ListIndex + 1 & "�" & Combo1.Text 
& "��"
End Sub

7-4
���һ�����̣��ù��̰�һ�������һ����׼ģ�顣��׼ģ�����й��Array_Sum������
��ά����a(m,n) ����Ԫ�صĺͣ�������õĺʹ���һά����b(m)�У������������ť 

Command1,�����ð�ť������10-99֮���������ڶ�ά����iArray��5��8���У�����5��
8�е���ʽ�ڴ�������ʾ�����ñ�׼ģ���еĹ����ÿ��Ԫ�صĺͣ��������͵Ľ�� 


Private Sub Command1_Click()
Dim iArray(1 To 5, 1 To 8) As Integer, dat(1 To 8) As Integer, A As Integer, 
i As Integer, j As Integer
Randomize
i = 1
Do While i < 6
  j = 1
  Do While j < 9
    A = Int(100 * Rnd)
    If A > 9 Then iArray(i, j) = A: j = j + 1
  Loop
  i = i + 1
Loop
Width = 9800
Cls
For i = 1 To 5
  For j = 1 To 8
    Print Str(iArray(i, j)) & "  ",
  Next
  Print
Next
For i = 1 To 5
  For j = 1 To 8
    dat(j) = iArray(i, j)
  Next
  Print "��" & i & "��֮�ͣ�" & Array_Sum(dat)
Next
End Sub

Function Array_Sum(B() As Integer) As Integer
Dim k As Integer
For k = 1 To 8: Array_Sum = Array_Sum + B(k): Next
End Function
Technical Details
Message-ID: <emkvkh$3d4$1@news.cn99.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.cn99.com!not-for-mail
References: <4RcNBa$68i@newsmth.net>

Show Full Headers
Complete Article Headers
X-Google-Thread: 109fdd,5d6aee0b6b49f836
X-Google-Attributes: gid109fdd,public
X-Google-Language: Chinese,GB
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!news.cn99.com!not-for-mail
From: "һ����ˮ" <wangzhichao_812@msn.com>
Newsgroups: cn.bbs.comp.lang.visual-basic
Subject: Re: ��ţ�ܲ��ܰ�æ������ҵ����
Date: Sun, 24 Dec 2006 11:45:07 +0800
Organization: Bentium Ltd. (CN99)
Lines: 65
Message-ID: <emkvkh$3d4$1@news.cn99.com>
References: <4RcNBa$68i@newsmth.net>
NNTP-Posting-Host: 222.245.30.142
X-Trace: news.cn99.com 1166934481 3492 222.245.30.142 (24 Dec 2006 04:28:01 GMT)
X-Complaints-To: usenet@news.cn99.com
NNTP-Posting-Date: Sun, 24 Dec 2006 04:28:01 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2527
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Original