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

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

以下程序段的输出结果是_______。 x= 10 while x>0: x -= 1 if x%2 == 0: print(x,end = ',' )

A.9,7,5,3,1,

B.8,6,4,2,

C.8,6,4,2,0,

D.10,8,6,4,2,


参考答案和解析
5
更多 “以下程序段的输出结果是_______。 x= 10 while x>0: x -= 1 if x%2 == 0: print(x,end = ',' )A.9,7,5,3,1,B.8,6,4,2,C.8,6,4,2,0,D.10,8,6,4,2,” 相关考题
考题 有程序段 for i:=1 to 10 do begin j:=i mod 4; case j of 0:x:‘a‘; 1:x:=‘b‘; 2:x:=‘c‘; 3:x:=‘d‘ end; end; for i:=1 to 10 do write(x:1); writeln; 输出应为( )。 AbcdabcdabcBabcdabcdabCcdabcdabcdDdabcdabcda

考题 假定有如下事件过程: Privte Sub Form_Click0 Dim x As Integer,n As Integer x=1 n=0 Do While x<28 x=x*3 n=n+1 Loop Print x,n End Sub 程序运行后,单击窗体,输出结果是( )。A.81 4B.56 3C.28 1D.243 5

考题 下列程序执行后,输出的结果是( )。 int x=-5,y=0; while(++x) y++; cout<<y<<end1;A.1B.2C.4D.5

考题 有以下函数过程: Function Gys (ByVal x As Integer, ByVal y As Integer) As Integer Do While y<>0 Reminder = x Mod y x = y y= Reminder Loop Gys=x End Function 以下是调用该函数的事件过程,该程序的运行结果是 Private Sub Command1_Click() Dim a As Integer Dim b As Integer a = 50 b = 10 x=Gys (a,B)Print x End SubA.0B.10C.50D.100

考题 有以下程序: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

考题 有以下程序段: int x=3; do { printf("%d",x-=2); } while(!(--x)); 其输出结果是 ______ 。A.1B.3 0C.1-2D.死循环

考题 执行下面程序,第一行输出结果是【 】,第二行输出结果是47。Option ExplicitPrivate Sub Form_Click( )Dim A As IntegerA=2Call Sub1 (A) End SubPrivate Sub1 (x As Integer)x=x*2+1If x<10 ThenCall Sub1 (x)End Ifx=x*2+1Print xEnd Sub

考题 假定有如下事件过程: Privte Sub Form_Click() Dim x As Integer,n As Integer x=1 n=0 Do While x<28 x=x*3 n=n+1 Loop Print x,n End Sub 程序运行后,单击窗体,输出结果是A.81 4B.56 3C.28 1D.243 5

考题 下列程序段的执行结果为______。 x = 0: y = 1 z = 1: n = 0 Do x = x + y + z n = n + 1 Loop While x < 10 Print x; nA.10 5B.x nC.9 5D.10 6

考题 有如下事件过程: Function UNC (ByVal x As Integer,ByVal y As Integer) As Integer Do While y<>0 sic=x/y x=y y=sic Loop UNC=x End Function 以下是该函数的调用过程,该程序的运行结果是 PriVate Sub COmmand1_Click() Dim a As Integer Dim b As Integer a=12 b=2 x=UNC (a,B)Print x End SubA.0B.6C.2D.80

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

考题 下面的程序执行时,可以从键盘输入一个正整数,然后把该数的每位数字按逆序输出。例如:输入7685,则输出5 8 6 7;输人1000,则输出0 0 0 1。请填空。 Private Sub Command1_Click Dim x As Integer X=InputBox(“请输入一个正整数”) While x 【11】 Print x Mod 10; x=x\10 Wend Print 【12】 End Sub

考题 有以下程序:include using namespace std;class sample{private: int x; static int 有以下程序:#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=20B.x=20,y=30C.x=30,y=20D.x=30,y=30

考题 以下程序输出1到1000之间所有的偶数之和,请补充完该程序。 Private Sub Cotmand1_Click() Dim x As Double For i=0 To 1000 If______ Then x=x+ i End If Next i Print x End SubA. i Mod 2= 0B.x mod 2=0C.I mod 2<>0D.x mod 2<>0

考题 以下程序段的输出结果是【 】。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<<' , ';}

考题 窗体上有一个名称为Command1的命令按钮,并有如下程序: Private Sub Command1 Click( ) x=14 Do While x0 x=x-3 x=IIf(Int(x/5)=x/5,x+2,x) Loop Print x End Sub 程序运行后,单击命令按钮Command1,输出结果为( )。A.0B.-lC.-2D.-_3

考题 有如下程序 x=InputBox("input value of x") Select Case x Case Is0 y=y+l Case Is=0 y=x+2 Case Else y=x+3 End Select. Print x: y 运行时,从键盘输入—5,输出的结果是( )。A.-7B.-9C.-8D.-10

考题 有以下程序段:int x=3;do{printf(%d,x-=2);)while(!(--x));其输出结果是( )。A.1B.3 0C.1 -2D.死循环

考题 运行下列程序: 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.-7B.-9C.-8D.-10

考题 以下程序的输出结果是______。 main() { int x=2; do{ printf("%3d",!x-2); }while(--x); }A.0 -1B.0 0C.-4D.死循环

考题 有以下程序:include using namespace std;int main() {int x=15;while(x>10 int main() { int x=15; while(x>10x<50) { x++; if(x/3) { x++; break; } } cout<<x<<end1; return 0; } 执行后的输出结果是A.15B.16C.17D.18

考题 有如下程序: 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.-7B.-9C.-8D.-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 SubA.1B.2C.3D.4

考题 有以下程序:includemain(){int x=0,y=5,z=3; while(z-->0 ++x 有以下程序: #include <sldio.h> main() { int x=0,y=5,z=3; while(z-->0 ++x<5) y=y-1; printf("%d,%d,%d\n",x,y,z); } 程序执行后的输出结果是( )。A.3,2,0B.3,2,-1C.4,3,-1D.5,-2,-5

考题 有以下程序段 int x=3 do { printf(""%d"",x-=2); } while (!(--x)); 其输出结果是()A、1B、3、0C、1、-2D、死循环

考题 有以下程序段,其输出结果是()int x=3;while((--x)==0){Console.Write("{0}/t",x-=2);}A、不执行循环体B、1C、0D、死循环

考题 单选题有以下程序段,其输出结果是()int x=3;while((--x)==0){Console.Write("{0}/t",x-=2);}A 不执行循环体B 1C 0D 死循环

考题 单选题有以下程序段 int x=3 do { printf(""%d"",x-=2); } while (!(--x)); 其输出结果是()A 1B 3、0C 1、-2D 死循环