我也是自学的。看在你没老师的份上给你编了前几题。后面三个题实在不想编了。其实后三个题也很容易。
1、
Dim I As Long
Private Sub Form_Load()
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
I = I + 1
Label1 = I
Beep
End Sub
2、
Private Sub Command1_Click()
For I = 1 To 30
For J = I To 30
If Int(Sqr(I ^ 2 + J ^ 2)) = Sqr(I ^ 2 + J ^ 2) Then
If Sqr(I ^ 2 + J ^ 2) <= 30 Then Print I & "," & J & "," & Sqr
(I ^ 2 + J ^ 2)
End If
Next J
Next I
End Sub
3、
Private Sub Command1_Click()
M = Int(InputBox("请输入M的值:", "输入数据", 84))
N = Int(InputBox("请输入N的值:", "输入数据", 48))
If M < N Then Max = M Else Max = N
Do While Max > 1
Max = Max - 1
If M Mod Max = 0 And N Mod Max = 0 Then Exit Do
Loop
Print M & "与" & N & "的最大公因子是" & Max
End Sub
4、
fPrivate Sub Command1_Click()
Dim I As Long
M = Int(InputBox("请输入M的值:", "输入数据", 84))
N = Int(InputBox("请输入N的值:", "输入数据", 48))
If M < N Then
Max = M
M = N
N = Max
End If
For I = N To M
If Wqs(I) Then Print I
Next I
End Sub
Private Function Wqs(A As Long) As Boolean
For I = 1 To Int(A / 2)
If A Mod I = 0 Then k = k + I
Next I
If k = A Then Wqs = True Else Wqs = False
End Function
8、
Private Sub Command1_Click()
Dim IntS(1 To 10) As Long
Dim IntT(1 To 10) As Long
For I = 1 To 10
IntS(I) = InputBox("请输入第" & I & "个数据", "", "")
IntT(11 - I) = IntS(I)
Next I
Print "交换前:"
For I = 1 To 10: Print "(" & I & ")"; IntS(I);: Next I
Print "交换后:"
For I = 1 To 10: Print "(" & I & ")"; IntT(I);: Next I
End Sub
dim a as integer
formload()里a=0 然后在 timer1_timer() 里 label1.caption=cstr(a)
a=a+1
是回车
凡事都要自己先动脑动手,见题抄解,永远学不会.
鄙视一下不学只抄的学生,花钱浪费青春!
宁可被删除,宁可被扣分,谨以此唤醒像你以及和你一样的学生们!
诶,书店里都有
自己动脑筋吧,把一年的作业都贴上了?