2009年3月13日 星期五

以前校內程式設計比賽的題目-第二題

image

image

image

Public Class Form1
    Dim a, s As Integer
    Dim v As String
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        a = InputBox("請輸入N值:")
        If a <= 100 And a >= 10 Then
            For s = 1 To a
                If s Mod 7 = 1 Then
                    v = v & s & " "
                End If
            Next
        End If
        TextBox1.Text = v
    End Sub
End Class

沒有留言:

張貼留言