现有如下程序: Private Sub Command1_Click() s=0 For i=1 To 5 s=s+f(5+i) Next Print s End Sub Public Function f(x As Integer) If x>=10 Then t=x+1 Else t=x+2 End If f=t End Function 运行程序,则窗体上显示的是( )。A.38B.49C.61D.70
现有如下程序: Private Sub Command1_Click() s=0 For i=1 To 5 s=s+f(5+i) Next Print s End Sub Public Function f(x As Integer) If x>=10 Then t=x+1 Else t=x+2 End If f=t End Function 运行程序,则窗体上显示的是( )。
A.38
B.49
C.61
D.70
相关考题:
有如下程序:includeusing namespace std;Class TestClass{private:int x,y;public:Te 有如下程序: #include<iostream> using namespace std; Class TestClass { private: int x,y; public: TestClass(int i,int j) { x=i; y=j; } void print() { cout<<“print1”<<endl; } void print()const { cout<<”prinA.printlB.print2C.printl print2D.程序编译时出错。
有如下程序: include using namespace std; class TestClass { private: int x,y; pu 有如下程序: #include<iostream> using namespace std; class TestClass { private: int x,y; public: TestClass (int i,int j) { x=i; y=j; } void print() { cout<<"print1"<<end1; } void print()const { cout<<"print2"<<end1; } }; int main() { const TestClass a(1,2); a.print(); return 0; } 该程序运行后的输出结果是( )。A.print1B.print2C.print1 print2D.程序编译时出错
有如下程序: #includediostream usingnamespacestd; classTestClass {private: intX,y; public: TestClass(inti,intj) {x=i; y=j;} voidprint() {cout"printl"endl;} voidprint()const {cout"print2"endl;}}; intmain() {constTestClassa(1,2); print(); return0;} 该程序运行后的输出结果是( )。A.printlB.print2C.printlprint2D.程序编译时出错
有如下程序: #includediostream usingnamespacestd; classTestClass { private: intx,Y; public: TestClass(inti,intj) { x=i: y=j; } voidprint() { cout"printl"endl; } voidprint()const { cout"print2"endl; } }; intmain() { constTestClassa(1,2); print(); return0; } 该程序运行后的输出结果是( )。A.printlB.print2C.printlprint2D.程序编译时出错
有如下程序:#includediostreamusingnamespacestd;classTestClass{private:intX,y;public:TestClass(inti,intj){x=i;y=j;}voidprint(){coutprintlendl;}voidprint()const{coutprint2endl;}};intmain(){constTestClassa(1,2);print();return0;}该程序运行后的输出结果是( )。A.printlB.print2C.printlprint2D.程序编译时出错
4、以下程序的运行结果为____________。 s="498327" for i in range(0,len(s)): if s[i]=="6": print(i) break else: print(-1)
以下程序的运行结果为____________。 s="498327" for i in range(0,len(s)): if s[i]=="6": print(i) break else: print(-1)
以下程序的运行结果为___________。 s="498327" for i in range(0,len(s)): if s[i]=="2": print(i) break else: print(-1)
功能:下面的程序是求1!+3!+5!+……+n!的和。 #include <stdio.h> int main() { long int f,s; int i,j,n; _________; scanf("%d",n); for(i=1;i<=n; i+=2) { f=1; for(j=1; j<=i;j++) ________ ; s=s+f; } printf("n=%d,s=%ldn",n,s); return 0; }