| 网站首页 | 业界新闻 | 群组 | 交易 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛

已结贴   问题点数：5  回复次数：3

...........22221237542221111211111111111111111111111112212212222222222.............
..........2222121902211111221222111112111122112222221212112111111112222............
.........71211111....111111111111111111111122...22212121111221111..211121..........
.........111111111....111111111111111111111118...11111111111111111..1211127........
........1111141112....222111111111111211111111...21111211111111111..11111112.......
.......31111131111....112111111111111111111117...11111111111111111..11121113.......
......61111111111....111221121111112111212111...31111111111111111..211111125.......
......411111116111....112211111111111111111114...11111111111111111..111211224......
.....211111111112....121111111111111111111112...81111111111111212..211121128.......
....11111171111113....366111111111111111111116...11111111111111111..111111221......
....11111111111114231110281111111111111111111111111111111111111112111111121........
....11111111141171587651191111111111111111111111111112111111111111111111111........

得分:3
Dim str As String
Dim txt As String

Dim i As Integer
Dim a As Integer, b As Integer, c As Integer

Open "F:\123.TXT" For Input As #1

Do While Not EOF(1)
Line Input #1, str
For i = 1 To Len(str)           'for循环判断首数字出现位置并赋值给a
txt = Mid(str, i, 1)
If IsNumeric(txt) Then
Exit For
End If
Next i
a = i - 1
b = Len(str)                    '确定字符总长度
str = Replace(Trim(Replace(str, ".", " ")), " ", "M")  '赋值语句是为了截取中间位置，并替换
c = Len(str)
str = String(a, ".") & str & String(b - a - c, ".")
Text1.Text = Text1.Text + vbNewLine + str   '结果显示
Loop
得分:3
Private Sub Command1_Click()
Open "F:\123.TXT" For Input As #1
Do While Not EOF(1)
Line Input #1, txt
temp = Replace(txt, ".", " ")
L1 = String(Len(txt) - Len(LTrim(temp)), ".")
r1 = String(Len(txt) - Len(RTrim(temp)), ".")
m1 = Replace(Trim(temp), " ", "M")
temp = L1 & m1 & r1
Debug.Print temp
Loop
End Sub
得分:0

• 4
• 1/1页
• 1