用vb编写一个打印程序,功能是在vb中填写一些数据然后在赋值到固定表
用vb编写一个打印程序,功能是在vb中填写一些数据然后在赋值到固定表格得word中并打印word表格。那位大神会啊帮帮忙。...
用vb编写一个打印程序,功能是在vb中填写一些数据然后在赋值到固定表格得word中并打印word表格。那位大神会啊帮帮忙。
展开
1个回答
2016-10-11
展开全部
Private Sub Command1_Click()
Open "d:\data.txt" For Output As #1
Randomize
Print "输入文件:"
For i = 1 To 10
x = 30 + Int(Rnd * 61)
Print #1, x;
Print x;
Next i
Print
Close #1
Print "从文件中读出:"
Open "d:\data.txt" For Input As #1
Dim a(10)
s = 0
For i = 1 To 10
Input #1, a(i)
Print a(i);
s = s + a(i)
Next i
av = s / 10
Print
Print "平均值="; av
s = 0
For i = 1 To 10
s = s + (a(i) - av) * (a(i) - av)
Next i
s = Sqr(s / 10)
Print "标准方差="; s
End Sub
Open "d:\data.txt" For Output As #1
Randomize
Print "输入文件:"
For i = 1 To 10
x = 30 + Int(Rnd * 61)
Print #1, x;
Print x;
Next i
Close #1
Print "从文件中读出:"
Open "d:\data.txt" For Input As #1
Dim a(10)
s = 0
For i = 1 To 10
Input #1, a(i)
Print a(i);
s = s + a(i)
Next i
av = s / 10
Print "平均值="; av
s = 0
For i = 1 To 10
s = s + (a(i) - av) * (a(i) - av)
Next i
s = Sqr(s / 10)
Print "标准方差="; s
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询