2023-10-07 13:18来源:m.sf1369.com作者:宇宇
ck()
Cls
'第一题
Dim i As Integer, j As Integer
For i = 1 To 10
For j = 1 To 10
If i = j Or i + j = 11 Then Print 1; Else Print 0;
Next
Next
End Sub
Private Sub Command2_Click()
Text1.SetFocus
If Text1 = Then MsgBox 请把成绩复制到这里: Exit Sub
Text1 = Replace(Text1.Text, vbCrLf, )
Text1 = Replace(Text1.Text, 秒 , 秒 & vbCrLf)
End Sub
Private Sub Command3_Click()
Dim max, min
Dim i
Do
i = InputBox(请输入第 & i & 个数字,输入为空表示退出)
If i = Then Exit Do
If max = Then max = i
If min = Then min = i
If Val(max) < Val(i) Then max = i
If Val(min) > Val(i) Then min = i
Loop
MsgBox 最大数是 & max & vbNewLine & 最小数是 & min
End Sub
Private Sub Command4_Click()
Dim i As Integer, mystr As String
Dim mymod As Integer
i = InputBox(请输入一个十进制数字:)
mymod = i Mod 2
mystr = mymod & mystr
i = i \ 2
Do While i <> 0
mymod = i Mod 2
mystr = mymod & mystr
i = i \ 2
Loop
MsgBox 转换结果是 & mystr
End Sub
Private Sub Command5_Click()
Dim i, j As Integer
'二进制变十进制
Dim sum As Long
i = InputBox(请输入一个二进制数值:)
For j = 1 To Len(i)
sum = sum + Val(Mid(i, j, 1)) * 2 ^ (Len(i) - j)
Next
MsgBox sum
End Sub
(1):colspan=2
(2):<input type=text size=20 value=name />
(3):type=password
(4):type=submit
(5):value=重写
下面是全部代码:
<form>
<table bgcolor=#eeeeee>
<tr>
<td colspan=2 align=center><b>情况登记</b></td>
</tr>
<tr>
<td>姓名:</td>
<td><input type=text size=20 value=name /></td>
</tr>
<tr>
<td>密码:</td>
<td><INPUT type=password value=pwd size=20></td>
</tr>
<tr>
<td>性别:</td>
<td><INPUT name=sex type=radio>男 <INPUT name=sex type=radio>女</td>
</tr>
<tr>
<td colspan=2 align=center><INPUT type=submit value=提交> <INPUT type=reset value=重写></td>
</tr>
</table>
</form>
一定要注意闭合标签哦。
你啊。应该好好学习。
你把它保存成45.html然后在浏览器里打开它就能看到运行结果了
1 D
2 A
3 D
4 B
5 B
6 D
7 D
8 A
9 D
10 D
11 C
12 不知道
13 A
14 D
15 D
16 A
17 A
18 C
19 C
20 C
满意请采纳 谢谢。