napa6101 2009-2-7 19:38
乘數表生成器
我廢才,又來問
[attach]1680[/attach]
要寫一個像上圖的乘數表
一定要用For/next
這是我寫的,
Dim i, j As Integer
For i = 1 To 3
For j = i To 3
output.Text = i & " × " & j & " = " & Str(i * j)
i += i
Next j
j += j
Next i
請高人指點!
[[i] 本帖最后由 napa6101 于 2009-2-7 19:44 编辑 [/i]]
Nothing 2009-2-9 22:17
[color=#000000][color=#0000ff]Dim[/color] i[color=#0000cc],[/color] j As Integer
[color=#0000ff]For[/color] i [color=#0000cc]=[/color] 1 [color=#0000ff]To[/color] 3
[color=#0000ff]For[/color] j [color=#0000cc]=[/color] i [color=#0000ff]To[/color] 3
output[color=#0000cc].[/color]Text [color=#0000cc]=[/color]output[color=#0000cc].[/color]Text [color=#0000cc]&[/color][color=#ff00ff]" "[/color] [color=#0000cc]&[/color] i [color=#0000cc]&[/color] [color=#ff00ff]" × "[/color] [color=#0000cc]&[/color] j [color=#0000cc]&[/color] [color=#ff00ff]" = "[/color] [color=#0000cc]&[/color] Str[color=#0000cc]([/color]i [color=#0000cc]*[/color] j[color=#0000cc])[/color]
[color=#0000ff]Next[/color] j
[color=#0000ff]Next[/color] i[/color]