当计算电抗Xjs大于3.45时,可以认为短路电流周期分量不随时间变化,其有效值按公式1/Xjs计算。
第1题:
以下能够正确计算n!的程序是( )。
A.Private Sub Command1_Click()
n=5: x=1
Do
x=x * I
I=I + 1
Loop While I < n
Print x
End Sub
B.Private Sub Command1_Click()
n=5: x=1: I=1
Do
x=x * I
I=I + 1
Loop While I < n
Print x
End Sub
C.Private Sub Command1_Click()
n=5: x=1: I=1
Do
x=x * I
I=I + 1
Loop While I <=n
Print x
End Sub
D.Private Sub Command1_Click()
n=5: x=1: I=1
Do
x=x * I
I=I + 1
Loop While I > n
Print x
End Sub
第2题:
A、Public Sub Sum(x ; y)
B、Public Sub Sum(ByVal x, ByVal y)
C、Public Sub Sum(x As Integer,y As Integer)
D、Public Sub Sum(x%, y%)
第3题:
( 27 )要想在过程 Proc 调用后返回形参 x 和 Y 的变化结果,下列定义语句中正确的是
A ) Sub Proc ( x as Integer,y as Integer )
B ) Sub Proc ( ByVal x as Integer, y as Integer )
C ) Sub Proc ( x as Integer,Byval y as Integer )
D ) Sub Proc ( Byval x as Integer, Byval y as Integer )
第4题:
下面程序是由鼠标事件在窗体上画图,如果按下鼠标可以画图,双击窗体则可以清除所画图形。补充完整下面的程序。首先在窗体层定义如下变量:
Dim PaintStart As Boolean
编写如下事件过程:
Private Sub Form_Load()
DrawWidth=2
ForeColor=vbGreen
End Sub
Private Sub Form_MouseDown(Button As Integer,Shift As Integer,X AS Single,Y AS Single)
PaintStart=True
End Sub
Private Sub Form_MouseMove(Button As Integer,Shift As Integer,X As Single,Y As Single)
If PaintStart Then
PSet(X,Y)
End If
End Sub
Private Sub Form_MouseUp(Button As Integer,Shift As Integer,X As Single,Y As Single)
End Sub
Private Sub Form_DblClick()
Cls
End Sub
第5题:
下面各被调用函数首部书写正确的是( )
A.void sub(float x;float y);
B.void sub(float x,y)
C.void sub(float x,float y)
D.void sub(float x,float y);
第6题:
下列程序用来计算1+2+…n,当和大于100时停止计算,请填空。
Private Sub Form_Click()
Dim n as integer,s as integer,I as integer,k as integer
s=0
k=0
n=inputbox(″请输入n的值)
For i=1 to 100
k=k+1
s=s+I
【 】
Next i
Print s
End Sub
第7题:
以下程序的输出结果是【 】。
main()
{ int x=0;
sub(&x,8,1);
printf(“%d\n”,x);
}
sub(int *a,int n,int k)
{ if(k<=n)sub(a,n/2,2*k);
*a+=k;
}
第8题:
有以下程序:int sub(int n) { return(n/10+n%10); }void main(){ int x,y; scanf("%d",&x); y=sub(sub(sub(x))); printf("%d\n",y);}若运行时输入:4321<回车>,程序的输出结果是。
第9题:
在窗体中添加一个名称为Command1的命令按钮,然后编写如下程序: Public x As Integer Private Sub Command1_Click() x=10 Call s1 Call s2 MSgBox x End Sub Private Sub s1() x=x+20 End Sub Private Sub s2() Dim x As Integer x=X+20 End Sub 窗体打开运行后,单击命令按钮,则消息框的输出结果为______。
A.10
B.30
C.40
D.50
第10题:
有以下程序:
int sub(int n) { return(n/10+n%10); }
main()
{ int x, y;
scanf("% d", &x);
y=sub(sub(sub(x)));
printf("% d\n", y);
}
若运行时输入:1234<回车>,程序的输出结果是【 】。