利用VB编程,用*号组成三角形的代码:
Private Sub Form_click()
Dim i As Integer
Dim j As Integer
  For i = 1 To 7
    Print Tab(10 - i);
    For j = 1 To 2 * i - 1
      Print "*";
    Next j
  Next i
End Sub
用*号组成菱形的代码:
Private Sub FORM_Click()
For i = 0 To 3
    For j = 0 To 3 - i
        Print " ";
    Next j
    For k = 0 To 2 * i + 1
        Print "*";
    Next k
    Print
Next i
For i = 0 To 2
    For j = 0 To i + 1
        Print " ";
    Next j
    For k = 0 To 4 - 2 * i
        Print "*";
    Next k
    Print
简单的vb程序代码
Next i
End Sub

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。