有下列程序段,单击命令按钮执行程序后,输出结果为( )。 Option Base 1 Private Sub Command1_Cliek() Dim x x=Array(23, -5, 17, 38, -31, 46, 11, 8, 5, -4) s1=0 s2=0 Fork=1 To 10 If (x(k)>0) Then s1=s1+x(k) Else s2=s2+x(k) End If Next k Y=s1/Abs(s2) Print Y End SubA.148B.40C.-40D.3.7
有下列程序段,单击命令按钮执行程序后,输出结果为( )。 Option Base 1 Private Sub Command1_Cliek() Dim x x=Array(23, -5, 17, 38, -31, 46, 11, 8, 5, -4) s1=0 s2=0 Fork=1 To 10 If (x(k)>0) Then s1=s1+x(k) Else s2=s2+x(k) End If Next k Y=s1/Abs(s2) Print Y End Sub
A.148
B.40
C.-40
D.3.7
相关考题:
在窗体上画一个命令按钮,然后编写如下程序(假定变量x是—个窗体级变量)Dim x As IntegerSub inc(a AS Integer)X=K+aEnd SubPrivate Sub Command1_Click()inc2inc3inc4Prmt x;Ead Sub程序执行后,单击Command1命令按钮,输出的结果是【 】。
有以下程序include using namespace std:class Base{private:char c;public:Base(cha 有以下程序#include <iostream>using namespace std:class Base{private: char c;public: Base(char n) :c(n) {} ~Base ( ) { cout<<c; }}; class Derived : public Base{private: char c;public: Derived(char n):Base (n+1),c(n) {} ~Derived() { cout<<c; }};int main(){ Derived obj('x'); return 0;} 执行后的输出结果是A.xyB.yxC.xD.y
单击命令按钮,下列程序段的输出结果为______。 Private Sub Command1_Click() Dim n As Integer n = 5 While n <= 10 n = n + 2 Print n; Wend End SubA.5 7 9 11B.6 8 10C.7 9 11D.6 8 10 12
有以下程序includeusing namespace std;class Base{private:char c;public:Base(char 有以下程序 #include<iostream> using namespace std; class Base { private: char c; public: Base(char n):c(n){} ~Base() { cout<<c; } }; class Derived:public Base { private: char c; public: Derived(char n):Base(n+1),c(n){} ~Derived() { cout<<c; } }; int main() { Derived obj('x'); return 0; } 执行后的输出结果是A.xyB.yxC.xD.y
在窗体上画一个名为Command1的命令按钮,编写如下程序:程序运行后,单击命令按钮,输出的结果是_________。