2009年2月27日 星期五

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

image

image

Public Class Form1
    Dim a As Single
    Dim s As Integer
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        a = 0
        a = TextBox1.Text
        a = a * 1000
        If a <= 1000 Then
            s = 70
        Else
            a = a - 1000
            If a Mod 400 = 0 Then
                s = 70 + ((a / 400) * 5)
            Else
                s = 70 + ((a \ 400) * 5) + 5
            End If
        End If
        TextBox2.Text = s
    End Sub
End Class

沒有留言:

張貼留言