下面的一段程序是标签二值化的示例程序,则最后的print语句的输出应该为: from sklearn.preprocessing import label_binarize y=[0, 1, 2] print (y) y = label_binarize(y, classes=[0, 1, 2]) print (y)
A.[[0 0 1] [0 1 0] [1 0 0]]
B.[[1 0 0] [1 0 0] [1 0 0]]
C.[[0 0 1] [0 0 1] [0 0 1]]
D.[[1 0 0] [0 1 0] [0 0 1]]
第1题:
下列程序段的执行结果为 ______。 X=2 Y=1 If X*Y<1 Then Y=Y-1 Else Y=-1 Print Y-X>0
A.True
B.False
C.-1
D.1
第2题:
执行下列程序段后,输出的结果是
For k1=0 To 4
y=20
For k2=0 To 3
y=10
For k3=0 To 2
y=y+10
Next k3,k2,k1
Print y
A.90
B.60
C.40
D.10
第3题:
执行下列程序段后,输出的结果是 For k1 = 0 To 4 y =20 For k2 = 0 To 3 y=10 For 16 = 0 To 2 y=y+10 Next Next Next Print y
A.90
B.60
C.40
D.10
第4题:
以下程序运行后的输出结果是 ______。 Sub add(x,y) x=x+y Print "x=";x;",y=";y End Sub Private Sub Command1_Click() x=1 y=1 Call add((x),(y)) Print"x="; x;",y=";y End Sub
A.x=1,y=1 x=2,y=2
B.x=2,y=1 x=1,y=1
C.x=1,y=1 x=1,y=1
D.x=2,y=1 x=2,y=1
第5题:
有如下程序: #included<iostream> 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.printl
B.print2
C.printlprint2
D.程序编译时出错
第6题:
下列程序执行之后,将输出 public class exl9 { public static void main(string[] args) { int x=3; int y=7; switch(y/x){ case 1: y*=2; break; case 2: y*=3; break; case 3: y*=4; break; default: y=0; } System.out.print(y); } }
A.28
B.21
C.14
D.0
第7题:
下列条件语句中,输出结果与其他语句不同的是( )。
A.if(a)printf("%d n",x); else print[("%d\n",y)
B.if(a=0)pritf("%d n",y); else print[("%d\n",x)
C.if(a!一0)printf("%d n",x); else print[("%a\n",y)
D.if(a=O)print[("%d n",x); else printf("%d\n",y)
第8题:
有如下程序:
#included<iostream>
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.printl
B.print2
C.printlprint2
D.程序编译时出错
第9题:
有以下类定义: class Point { public: Point(int x=0,int y=0){_x=x; _y=y;} void Move(int x Off, int y Off) {_x+=x Off; _y+=y Off; } void Print() const { cout <<'(' << _x << ',' << _y << ')'<< end 1;} private: int _x,_y; }下列语句中会发生编译错误的是______。
A.Point pt; pr. Print();
B.const Point pt; pt. Print();
C.Point pt; pt. Move(1,2);
D.const Point pt; pt. Move(1,2);
第10题:
下列程序执行的结果是______。 Private Sub Command1_Click() x=25 If x>0 Then y=1 If x>10 Then y=2 If x>20 Then y=3 If x>30 Then y=4 Print y End Sub
A.1
B.2
C.3
D.4
第11题:
如果X的值小于或等于Y的平方,则打印"OK",表示这个条件的单行格式If语句是()
第12题:
If x>=y^3 Print “OK”
If x>=y*y*y Then “OK”
If x>=y^3 Then Print “OK”
If x>=y*y*y Then Print “OK” End If
第13题:
下列程序段的执行结果为 X=2 Y=5 If X * Y <1 Then Y=Y - 1 Else Y=-1 Print Y-X>0
A.True
B.False
C.-1
D.1
第14题:
有如下程序: #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.print1
B.print2
C.print1 print2
D.程序编译时出错
第15题:
以下程序运行后的输出结果是______。 Private Sub Form_ Click() y=1 :x=2 Print Iif(x>=y,x,y) End Sub
A.0
B.1
C.2
D.3
第16题:
当变量x=2,y=5时,以下程序的输出结果为 Do Until y>5 x=x*y y=y+1 Loop Print x
A.2
B.5
C.10
D.20
第17题:
有以下程序:#include <iostream>using namespace std;class sample{private: int x; static int y;public: sample(int a); static void print(sample s);};sample:: sample(int a){ x=a; y+=x;}void sample:: print(sample s){ cout<<"x="<<s. x<<",y="<<y<<end1;}int sample:: y=0;int main(){ sample s1(10); sample s2(20); sample:: print(s2); return 0;}程序运行后的输出结果是( )。
A.x=10,y=20
B.x=20,y=30
C.x=30,y=20
D.x=30,y=30
第18题:
执行下列程序段后,输出的结果是( )。 Forkl=0 To 4 y=20 For k2=0 To 3 y=10 Fork3=0 To 2 y=y+10 Next k3 Next k2 Next k1 Print y
A.90
B.60
C.40
D.10
第19题:
以下程序段的输出结果是( )。 x=1 y=4 Do Until y>4 x= x * y y=y+1 Loop Print X
A.1
B.4
C.8
D.20
第20题:
执行下列程序段后,输出的结果是 For k1=0 To 4 Y=20 For k2=0 To 3 y=10 For k3=0 To 2 y=y+10 Next k3,k2,k1 Print y
A.90
B.60
C.40
D.10
第21题:
有如下程序: x = InputBox("Input value of x") Select Case x Case Is > 0 y=y+1 Case Is = 0 y=x + 2 Case Else y=x + 3 End Select Print x, y运行时,从键盘输入-5,输出的结果是( )。
A.-7
B.-9
C.-8
D.-10
第22题:
执行下列程序段后,输出的结果是 For k1=0 To 4 y=20 For k2=0 To 3 y=10 For k3=0 To2 y=y+10 Next k3,k2,k1 Print y
A.90
B.60
C.40
D.10
第23题:
如果x的值大于或等于y的立方,则打印“OK”,表示这个条件的单行格式的If语句是()
第24题:
If x<=y2 Then Print″OK″
If x<=y^2 Print″OK″
If x<=y^2 Then″OK″
If x<=y^2 Then Print″OK″