网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)

以下程序的输出结果是:() ls = ["浣熊","豪猪","艾草松鸡","棉尾兔","叉角羚"] x = "豪猪" print(ls.index(x,0))

A.0

B.-4

C.-3

D.1


参考答案和解析
D
更多 “以下程序的输出结果是:() ls = ["浣熊","豪猪","艾草松鸡","棉尾兔","叉角羚"] x = "豪猪" print(ls.index(x,0))A.0B.-4C.-3D.1” 相关考题
考题 若有如下程序:public class Test {public static void main (String[] args) {int x=20;if (x>10) System.out.print(x-=5);if (x>5) System.out.print(x--);}}则程序运行后的输出结果是【 】。

考题 以下程序的输出结果是【 】。x=12.7x=Int(x+0.5)Print X

考题 以下程序的输出结果是______。 include define FUDGE(y)2.84+y define PR(a) printf( 以下程序的输出结果是______。 #include<stdio.h> #define FUDGE(y) 2.84+y #define PR(a) printf("%d",(int)(a)) #define PRINT1(a) PR(a);putchar('\n') main() { int x=2; PRINT1(FUDGE(5)*x); }A.11B.12C.13D.15

考题 以下程序的输出结果是( )。 include void fun(int x) {if(x/2>0)fun(x/2); printf("%d", 以下程序的输出结果是( )。include<stdio.h>void fun(int x){ if(x/2>0)fun(x/2);printf("%d",x);}main(){fun(3);printf("\n");}

考题 以下程序的输出结果是( )。 main {int x=0.5;char z=a; printf("%d\n",(x2));}A.0S 以下程序的输出结果是( )。 main {int x=0.5;char z=a; printf("%d\n",(x&1)&&(z2));}A.0B.1C.2D.3

考题 以下程序的输出结果是 ( ) fun (int x,int y, int z) { z=x * x+y * y;} main( ) { int a=31; fun(5,2,a); print{("%d",a); }A.0B.29C.31D.无定值

考题 下列程序的输出结果是【】。 include using namespace std; class A {int a; public:A() 下列程序的输出结果是【 】。include <iostream>using namespace std;class A {int a;public:A():a(9){}virtual void print() const { cout<<a;};};class B: public A {char b;public:B( ){b='S';}void print() const {cout<<b;}};void show(A x){ x.print0;}int main(){ Ad1,*p;B d2;p=d2;d1.print();d2.print0;p->print();show(d1);show(d2);return 0;}

考题 下面程序段的输出结果是【 】。For X=1.5 To 5 Step 1.5Print X;Next X

考题 以下程序运行后的输出结果是 【 】。includestdio.hmain( ){ int x=20;prinff(“%d”,0x20);prinff(“%d\n”,0x&&x20);}

考题 以下程序的输出结果是includevoid main( ){int i,j,x=0;for(i=0;i 以下程序的输出结果是 #include<iostream.h> void main( ) {int i,j,x=0; for(i=0;i<2;i++) { x++; for(j=0;j<3;j++) { if(j%2)continue; x++;} x++;} cout<< "x="<<x;}A.x=4B.x=8C.x=6D.x=12

考题 有以下程序:includeusing namespace std;classA{private: int x;public: A(int a) {x 有以下程序: #include<iostream> using namespace std; class A { private: int x; public: A(int a) { x=a; } friend class B; }; class B { public: void print(A a) { a.x--; cout<<a, x<<end1; } }; int main () { A a(10); B b; b.print (a) ; return 0; } 程序执行后的输出结果是( )。A.9B.10C.11D.12

考题 有以下程序: include difine F(X, Y)(X)*(Y)main(){int a=3, b=4; print("% d\n", 有以下程序: # include<stdio. h> # difine F(X, Y) (X)*(Y) main() { int a=3, b=4; print("% d\n", F(a++, b++)); } 程序运行后的输出结果是______。A.12B.15C.16D.20

考题 以下程序的输出结果是______。includedefine FUDGE(y)2.84+ydefine PR(A)printf("%d" 以下程序的输出结果是______。 #include<stdio.h> #define FUDGE(y) 2.84+y #define PR(A) printf("%d",(int)(a) ) #define PRINT1(A) PR(a) ;putchar('\n') main() { int x=2; PRINT1(FUDGE(5)*X); }A.11B.12C.13D.15

考题 以下程序运行后的输出结果是( )。 include main() { int x=20; printf("%d", 0 以下程序运行后的输出结果是( )。include<stdio.h>main(){ int x=20;printf("%d", 0<x<20);printf("%d\n", 0<x x<20);}

考题 有以下程序: include class A { intx; public: A(int a) { x=a;} friend class B; 有以下程序:include<iostream.h>class A{int x;public:A(int a){x=a;}friend class B;}class B{public:void print(A a){a. x--;cout<<a.x<<end1;}};void main(){A a(10);B b;b.print(a) ;}程序执行后的输出结果是【 】。

考题 以下程序运行后的输出结果是______。 Private Sub Form_ Click() y=1 :x=2 Print Iif(x>=y,x,y) End SubA.0B.1C.2D.3

考题 以下程序的输出结果是 ______。 x=2^-2 Print x EndA.4B.0.25C.4D.程序错误

考题 以下程序段的输出结果是【 】。int x, i ;for (i=1; i<=100; i++){ x=i;if (++x%2==0)if (++x%3==0)if(++x%7==0) cout<<i<<' , ';}

考题 以下程序段的输出结果是( )。 x=1 y=4 Do Until y4 x= x * y y=y+1 Loop Print XA.1SX 以下程序段的输出结果是( )。 x=1 y=4 Do Until y4 x= x * y y=y+1 Loop Print XA.1B.4C.8D.20

考题 有下列程序: fun(int x) {int p; if(x= =0 ‖ x= =1) return(3); p=x-fun(x-2); return p; } main( ) { print f("%d\n",fun(7 ));} 执行后输出的结果是( )。A.7B.3C.2D.0

考题 下列程序的输出结果是( )。 include int fun(int x) {int p;if(x==0‖x==1) return 3;el 下列程序的输出结果是( )。 #include<stdio.h> int fun(int x) { int p; if(x==0‖x==1) return 3; else p=x-fun(x-2); return p; } void main() { print f("\n%d", fun(5)); }A.5B.3C.7D.1

考题 下面程序的输出结果是 ( ) main( ) { char x=040; print{("%d\n",x=x<<1);}A.100B.160C.120D.64

考题 有以下程序: #include 〈iostream〉 using namespace std; class A { public: virtual void setx(int i,int j=0) { x=i; y=j; } virtual void print()=0; protected: int x,y; }; class B : public A { public: void print() { cout〈〈x*x〈〈", "; } }; class C : public A { public: void print() { cout〈〈x*x*x〈〈end1; } }; int main() { A *pa; B b; C c; pa=b; pa-setx(5); pa-print (); pa=c; pa-setx(2); pa-print(); return 0; } 程序运行后的输出结果是( )。A.25,8B.2,5C.5,2D.8,25

考题 以下程序的输出结果是()。includevoid main(){int i,j,x=0;fof(i=0;i 以下程序的输出结果是( )。 #include<iostream.h> void main() {int i,j,x=0; fof(i=0;i<2;i++= {x++; for(j=0:j<3;j++= {if(j%2)continue; x++; x++;} cout<<"x="<<X;=A.x=4B.x=8C.x=6D.x=12

考题 下列程序段:Dim x If x Then Print x Else Print x+1运行后,显示的结果是()。A、1B、0C、-1D、出错

考题 单选题有以下程序:#include #define F(x) 2.84+x#define PR(a) printf(%d,(int)(a))#define PRINT(a) PR(a);putchar('')main(){ PRINT(F(5)*2);}程序运行后的输出结果是(  )。A 12B 13C 15D 11

考题 单选题下列程序段:Dim x If x Then Print x Else Print x+1运行后,显示的结果是()。A 1B 0C -1D 出错

考题 单选题有以下程序:#includemain(){ int x=0x13; if(x=0x12)printf(True); printf(False);}程序运行后的输出结果是(  )。A TrueB TrueFalseC FalseD TrueFalseTrue