vb编写一个sub过程,重复打印给定的字符N次.

vb编写一个sub过程,重复打印给定的字符N次.,第1张

vb6

sub print(N as integer,c as string)

for i = 1 to N

print c

next

end sub

这个是每打印一次占一行

如果你要打印在春枝帆一扒雹搭森起的话

sub print(N as integer,c as string)

dim i as integer,s as string

s=""

for i = 1 to N

s=S &c

next

print s

end sub

Option Explicit

Dim X() As Long

Sub Fun(ByRef A() As Long)

Dim J As Integer

X(1) = 1

X(2) = X(1)

For J = 3 To UBound(A)

X(J) = X(J - 1) + X(J - 2)

Next J

End Sub

Private Sub Form_Load()

Dim I As Integer, n As Integer

Form1.AutoRedraw = True

Do

n = Val(InputBox("斗郑猛请输入数列的项数(空桥n>2)"丛模))

Loop Until n >2

ReDim X(1 To n)

Fun X()

For I = 1 To n

Print X(I),

If I Mod 5 = 0 Then Print

Next I

Print

End Sub


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12382066.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-25
下一篇 2023-05-25

发表评论

登录后才能评论

评论列表(0条)

保存