ALL the new life

關於部落格
開心就好 ,生活就是要活的自在快樂 。 

  • 1354

    累積人氣

  • 0

    今日人氣

    0

    訂閱人氣

VB

Private Sub Cmd1_Click()

    Dim A As Long

    Dim S As Long

    Dim z As Long

    Dim Q As Single

 

    If Val(T1.Text) Mod 2 <> 0 Then

        For A = 1 To T1 Step 2

            S = 1

            For Q = 1 To A

                S = S * Q

            Next Q

                z = Val(z) + Val(S)

        Next A

        L2.Caption = z

    Else

        L2.Caption = "請輸入基數"

    End If

  End Sub

 

Private Sub Form_Load()

    T1.Text = ""

    T1.FontSize = 15

    L1.Caption = "1!+3!+5!+7!+ ... +N! = "

    L1.FontSize = 15

    L2.Caption = ""

    L2.FontSize = 15

    L3.Caption = "N"

    L3.FontSize = 15

    Cmd1.Caption = "計算"

    Cmd1.FontSize = 15

    Form1.Caption = "1!+3!+5!+7!+ ... +N! 之和"

End Sub

相簿設定
標籤設定
相簿狀態