• 主页

# 小弟是初学者，谁能帮我把这两道题做出来啊！急啊！！！

jazbor 2002-12-30 11:35:25
1。打印下面的图形
1
121
12321
1234321
123454321
12345654321
1234567654321
123456787654321
12345678987654321

2.任意输入3个字母，由程序判断其中是否包括字母表的相邻字母

...全文
12 点赞 收藏 6

6 条回复

northwolves 2003-03-30
Private Sub Command1_Click()
MsgBox isneighber("acs") & vbCrLf & isneighber("buc")
End Sub

Function isneighber(ByVal x As String) As Boolean
If Len(x) >= 4 Or Len(x) < 3 Then Exit Function
isneighber = False
If Abs(Asc(Mid(x, 1, 1)) - Asc(Mid(x, 2, 1))) = 1 Or Abs(Asc(Mid(x, 2, 1)) - Asc(Mid(x, 3, 1))) = 1 Or Abs(Asc(Mid(x, 1, 1)) - Asc(Mid(x, 3, 1))) = 1 Then isneighber = True
End Function

hycghit 2003-03-29

Private Sub Command1_Click()
Dim int1 As Integer, int2 As Integer
CurrentX = 0: CurrentY = 100 ' 使第一行离标题栏100单位
For int1 = 1 To 9 ' 每次循环生成一行
For int2 = 1 To int1 ' 每次循环生成一项
Print Spc(3); CStr(int2); "×"; CStr(int1); "="; CStr(int1 * int2);
Next
Print ' 另起一行
Print ' 两行之间隔一空行
Next
End Sub

jazbor 2003-03-29
3Q

huangyun 2002-12-30
Private Sub Command1_Click()
If Len(Text1.Text) >= 4 Then MsgBox "输入数据必须等于三个字母", , "错误提示"
If Asc(Mid(Text1.Text, 1, 1)) + 1 = Asc(Mid(Text1.Text, 2, 1)) Or Asc(Mid(Text1.Text, 2, 1)) + 1 = Asc(Mid(Text1.Text, 3, 1)) Then MsgBox "Yes", , "Titile"
End Sub

huangyun 2002-12-30
Private Sub Command1_Click()
For i = 1 To 9
mystr = 1
For j = 2 To i
mystr = mystr & j
Next j
For k = i - 1 To 1 Step -1
mystr = mystr & k
Next k
mystr = CDec(mystr)
Print Spc(9 - i); mystr
Next i
End Sub

Juchiyufei 2002-12-30
for i%=1 to 9
print tab(10-i%);
for j%=1 to i%
print j%;
next
print
next

VB基础类

7452

VB 基础类