用SELECT巢狀寫出閏年 並顯示a為閏年 拜託好心人事幫忙><"3Q
a可用inputbox跟text 輸入 用msgbox輸出 !!3Q~~
2005-11-04 18:29:06 · 3 個解答 · 發問者 Anonymous in 電腦與網際網路 ➔ 程式設計
Private Sub Command1_Click()
a = InputBox("輸入")
If a Mod 4 = 0 And a Mod 100 <> 0 Or a Mod 400 = 0 Then
Print a & "為閏年"
Else
Print a & "為平年"
End If
End Sub
不知你說的是啥伊斯
2005-11-05 07:05:05 · answer #1 · answered by Anonymous · 0⤊ 0⤋
Private Sub Command1_Click()
Dim a As Integer, D As Date
On Error Resume Next
a = Val(InputBox("請輸入年份(西元)"))
D = CDate(a & "/ 2/ 29")
Select Case Err
Case 0
MsgBox a & "為閏年"
Case Else
MsgBox a & "非閏年"
End Select
End Sub
2005-11-05 18:16:31 · answer #2 · answered by W.J.S. 7 · 0⤊ 0⤋
Private Sub Command1_Click()
a = InputBox("輸入")
u4=a Mod 4 = 0
u100=a Mod 100
u400= a Mod 400
If (ua = 0 And u100 <> 0 )Or u400=0 Then
Print a & "為閏年"
Else
Print a & "為平年"
End If
End Sub
2005-11-05 07:33:16 · answer #3 · answered by Anonymous · 0⤊ 0⤋