🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: cn.bbs.comp.lang.visual-basic
3 messages
3 total messages Started by һֻ��������|Ǭ��һ�� Fri, 22 Dec 2006 14:52
Re: ��ţ�ܲ��ܰ�æ������ҵ����
#97
Author: һֻ��������|Ǭ��һ��
Date: Fri, 22 Dec 2006 14:52
17 lines
2177 bytes
����Ǻܼ�...
�� �� myohmy9999@smth.edu.cn-SPAM.no (111) �Ĵ������ᵽ: ��
: ���ѵ���ҵ����ţ���æ�ɡ�
: ���������Ǽ�����
: 5-7
: ...................

--
     �qo            PalSword������  �ڴ���ĵ���              o�r    
  ���q �r �q�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�r �q �r�� 
  �v( '')_�U �q���r�q���r�q    �q���r�q  �r�q���r�q���r�����r �U_('' )�u 
   / ( >��U �����s��������    �t���r��������  �������s��  �� �U�b< ) \  
   ~  ``  �U �t    �t  �s�t���s�t���s�t�s�s�t���s�t  �s�����s �U  ``  ~  
          �t�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�s         


�� ��Դ:��ˮľ���� newsmth.net��[FROM: 210.77.5.245]
Re: ��ţ�ܲ��ܰ�æ������ҵ����
#105
Author: һ����ˮ
Date: Sat, 23 Dec 2006 23:44
80 lines
4725 bytes
�������˼������������ˣ���������Ҳ�ܼ򵥣��Լ��������������

5-7
���������ҳ�1-100֮���������ʹ�������Ϊƽ��������5��4��10��6��13��12�ĺ�
����Ϊƽ�����ڴ���������������ť�����г���ʱ����������ʼ�����ť���ڴ�
�����1-100��������ƽ��������������ť���������

Private Sub Command1_Click()
Dim i As Integer, j As Integer, A As Single, B As Single
For i = 1 To 99
  For j = i + 1 To 100
    A = Round((j + i) ^ 0.5, 1): B = Round((j - i) ^ 0.5, 1)
    If A = Int(A) And B = Int(B) Then Print Str(i) & "," & Str(j) & vbCrLf
  Next
Next
End Sub

5-9
���һ���������֮�͵��������ı��?����������Ϊ����ȫ�����磬����28����
��Ϊ1��2��4��7��14�����1+2+4+7+14=28�����28��һ����ȫ���дһ�����򣬴Ӽ�����
��������M��N, ���M��N֮���������ȫ��

Private Sub Command1_Click()
Dim st As String, A As Long, B As Long, i As Long, j As Long, dat As Long
st = InputBox("�������һ������"): A = Val(st)
st = InputBox("������ڶ�������"): B = Val(st)
If B < A Then B = A: A = Val(st)
For i = A To B
  dat = 0
  For j = 1 To i - 1
    If i / j = i \ j Then dat = dat + j
  Next
  If dat = i Then Print Str(i) & vbCrLf
Next
End Sub

6-6
�ƶ���Ļ�����һ�����壬ʹ��Timer�ؼ���̣���������ʼ�����ť���ڴ����ϵ���Ļ��
ʼ�ƶ�����Ļ����Ϊ: ��Visual Basic��ӭ������ĻΪ��ɫ����2���֣���Ļ�ƶ���ʱ��
���Ϊ1/20�롣�������������ť���������

Option Explicit
Dim st As String, x As Integer

Private Sub Command1_Click()
st = "Visual Basic��ӭ����"
x = (Width - TextWidth(st)) / 2
Timer1.Enabled = True
Timer1.Interval = 200
Debug.Print Width, x
End Sub

Private Sub Timer1_Timer()
Cls
CurrentX = x: CurrentY = 1000
Print st
st = Right(st, Len(st) - 1) & Left(st, 1)
End Sub

7-5
��д���Dec_Num�������ж����Ƿ�Ϊ���������һ��������Ӹ�λ����λ�ϵ����ֵͼ���
��ƴ���Ϊ����������5431��98772�ȶ��ǽ��������¼�����У��Ӽ���������һ������
�����ó���Dec_Num����жϸ����Ƿ�Ϊ�����������ڴ����������

Private Sub Command1_Click()
Dim st As String
st = InputBox("������һ��2λ�����ϵ�������")
If Len(st) < 2 Then Exit Sub
If Val(st) < 10 Then Exit Sub
Print st & IIf(Dec_Num(st), "", "��") & "��һ��������"
End Sub

Function Dec_Num(Num As String) As Boolean
Dim i As Integer, A As String, B As String, BJ As Boolean
For i = 1 To Len(Num) - 1
  A = Mid(Num, i, 1): B = Mid(Num, i + 1, 1)
  If Val(A) <= Val(B) Then BJ = True: Exit For
Next
Dec_Num = Not BJ
End Function 
Re: ��ţ�ܲ��ܰ�æ������ҵ����
#118
Author: һ����ˮ
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads