VB迴圈怎做 極需 3分內!!

I=1 sum=0+1 = 1

I=2 sum=1+2 = 3

I=3 sum=3+3 = 6

I=4 sum=6+4 =10

I=5 sum=10+5 =15

I=6 sum=15+6 =21

I=7 sum=21+7 =28

I=8 sum=28+8 =36

I=9 sum=36+9 =45

I=10 sum=45+10 =55

需要與上面畫面出現ㄉㄧ樣

怎做

給我程式碼就好vb~

1 Answer

Rating
  • 10 years ago
    Favorite Answer

    Dim sum As Integer

    Dim i As Integer

    sum = 0

    For i = 1 To 10

    Print "I=" & Str(i) & " sum=" & Str(sum) & "+" & Str(i) & "=" & Str(sum + i)

    sum = sum + i

    Next i

    Source(s): 自己
Still have questions? Get your answers by asking now.