展开全部
看一下以下的程序会对你有帮助吗?
Private Sub Command1_Click()
Open "d:\123.txt" For Output As #1
Print #1, "1";
s = 1
For i = 2 To 10
Print #1, "+"; Trim(Str(i));
s = s + i
Next i
Print #1, "="; Trim(Str(s))
Close #1
End Sub
运行后文件的内容是:
1+2+3+4+5+6+7+8+9+10=55
Private Sub Command1_Click()
Open "d:\123.txt" For Output As #1
Print #1, "1";
s = 1
For i = 2 To 10
Print #1, "+"; Trim(Str(i));
s = s + i
Next i
Print #1, "="; Trim(Str(s))
Close #1
End Sub
运行后文件的内容是:
1+2+3+4+5+6+7+8+9+10=55
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |