填空题
以下程序计算自然数e的值,要求精确到10
15
,阅读下列程序。已知e的计算公式为:e=1+1/1!+1/2! + …+1/n!。请在
【6】
和
【7】
处填上正确内容。
Private Sub Commandl_ Click()
【6】
n =0: term = 1: t = 1
do
n= n +1
t=t/n
【7】
Loop while t >1.0E-15
Text1. Text = term
End Sub
【参考答案】
[6]
[6]Dim t As double
[7]term=term+ t
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
数据的基本单位是 【5】 。
点击查看答案
填空题
下面的程序是找出两个正整数a和b,使得a<b、a+ b=99、a和b的最大公约数是3的倍数,并统计满足条件数对的个数。Option ExplicitDim a As Integer, b As Integer, n As Integer, c As IntegerPrivate Function Gcd (ByVal a As Integer, Byval b As Integer) As Integer do c=a Mod b: a=b=c Loop 【13】 Gcd=aEnd FunctionPrivate Sub form_ Click() n=0 for a= 1 To 49 b= 【14】 c= Gcd (a, b) if c Mod 3= 0 then 【15】 Print a, b, c End if Next a Print nEnd Sub
点击查看答案&解析
相关试题
在窗体上有三个控件:名称为Label1的标签...
下列程序实现的功能是:当在窗体上单击时,...