下列程序运行结果是: a=3 b=5 if a>b: a,b=b,a print ("从小到大输出:") print (a,b)A.3,5B.3 5C.5,3D.5 3

下列程序运行结果是: a=3 b=5 if a>b: a,b=b,a print ("从小到大输出:") print (a,b)

A.3,5

B.3 5

C.5,3

D.5 3


参考答案和解析
B 【解析】求解本题的关键在于理解好3个DoWhile循环的执行顺序,第2个和第3个DoWhile循环嵌套在第1个DoWhile循环内,先执行第2个循环,然后是第3个循环,最后是外层循环即第1个DoWhile循环。程序执行如下:m=9,n=8;第1个DoWhile循环内,执行第2个Dowhile循环,m=m-n=1;退出第2个Dowhile循环:执行第3个Dowhile循环,n=n.m.,最后n的值为l:退出第3个DoWhile循环;退出第1个DoWhile循环。程序执行结果是l。

相关考题:

若有如下程序: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--);}}则程序运行后的输出结果是【 】。

以下程序运行时,输出的结果是 a $ = "China" b $ =Right$ (a$ ,3) : c$ =Strings (3,b$) Print c $A.ChiB.aaaC.iiiD.ina

有以下程序:includestdio.hmain( ){int a=2,b=2,C=2;print{(%d\n,a/bc);}程序运行后的输出结果是( )。A.0B.1C.2D.3

下列程序运行后在立即窗口输出的结果是A=0Print A+1A=3 A.1 B.-1 C.3 D.0

下列程序段的输出结果是( )。A=0Print A+1A=3A.1B.-1C.3D.0

有如下程序:AS="Flying": b$="Is":c$="funny!"Print a$+""+LCase$(b$)+""+ UCase$(e$)End运行后输出的结果是【 】。

运行以下程序段后,输出结果为 【 】 。a=3:b=2Print a*(a+B)

下列程序的输出结果是【】。 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;}

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

有下面的程序段,其功能是按图1所示的规律输出数据: Dim a(3,5)As Integer For i=1 To 3 For j=1 To 5 a(i,j)=i+j Print a(i,j); Next Print Next若要按图2所示的规律继续输出数据,则接在上述程序段后面的程序段应该是( )。A.For i=1 To 5 For j=1 To 3 Print a(j,i); Next Print NextB.For i=1 T0 3 For j=1 To 5 Print a(j,i); Next Print NextC.For j=l To 5 For i=1 To 3 Print a(j,i); Next Print NextD.For i=1 To 5 For=1 To 3 Print a(i,j): Next Print Next

以下程序运行后的输出结果是_______。includestdio.hmain( ){int a=200,b=010;print(”%d%d\n”,a,b);}

有以下程序: #includestdio.h main( ) {int a=2,b=2,C=2; print{("%d\n",a/bc); } 程序运行后的输出结果是( )。A.0B.1C.2D.3

请阅读程序: Private Sub Form. Click( ) m=1 For i=4To 1 Step-1 Print Str(m);m=m+1 For j=1 To i Print"*": Next j Print Next i End Sub 程序运行后,单击窗体,则输出结果是( )。A.1**** 2*** 3** 4*B.4**** 3*** 2** 1*C.**** *** ** *D.* ** *** ****

有如下程序aS-"Flying"b$="IS":c$""funny!"PrInt aS+""+LCase$(b$)+""+UCase$(cS)End运行后输出的结果是【 】。

以下程序运行后的输出结果是 。includemain(){int a;a=(int)((double)(3/2)+0.5+(int)1.99*2);print{(“%d\n”,a);}

有如下程序: 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.程序编译时出错

下面程序的输出结果是()。includeClass example{int a;public:example(int B.{a=b++ 下面程序的输出结果是( )。 #include<iostream.h> Class example {int a; public: example(int B.{a=b++;} void print(){a=a+1 cout<<a<<““;} void print()const{cout<<a<<““;} }; void main() {example x(3); Const example y(2); x.print();A.2 2B.4 3C.4 2D.3 2

下面程序的输出结果是 include class example {int a; public: example(int b) {a= 下面程序的输出结果是#include<iostream.h>class example{int a;public:example(int b) {a=b++;}void pnnt( ) {a=a+1;cout < < a < <" ";}void print( ) const{cout < < a < <" ";}};void main( ){example x(3) ;const example y(2) ;x.print( ) ;y.print( ) ;}A.2 2B.4 3C.4 2D.3 2

下列程序段,运行后输出的内容是 a=2 c=1 c=c+a If c<10 Then Print c Else Print a End IfA.3B.7C.9D.6

下列程序运行结果是 a=25:b=-45 i=Not a=b Print iA.-45B.TrueC.0D.不能输出

下面程序的输出结果是includeclass example{ int a;public: example(int b){a=b++; 下面程序的输出结果是 #include<iostream.h> class example { int a; public: example(int b){a=b++;} void print(){a=a+1; cout<<a<<" ";} void print()const{cout<<a<<" ";} }; void main() { example x(3); const example y(2); x.print(); y.print(); }A.2 2B.4 3C.4 2D.3 2

下列程序的输出结果是()。 include main() {int a=4;print f("%d\n", (a+=a-=a*a)); }A 下列程序的输出结果是( )。 #include<stdio.h> main() { int a=4; print f("%d\n", (a+=a-=a*a)); }A.-8B.14C.0D.-24

以下程序运行后输出的结果是 ______。 a = 3 b=-123 m=Len(Str$(A)+Str$(B)) Print m EndA.9B.5C.7D.8

下面程序段的输出结果是:int a = 2;System.out.print( a++);System.out.print( a);System.out.print(++a); A.333B.334C.234D.233

a=10ifa==10:print(a-10)else:print[a]程序的输出结果是()。A、0B、10C、-10D、程序异常

以下程序段的输出结果是()(□表示空格) Print"a";Tab(3);"b"A、a□bB、□a□□□□bC、a□□□bD、a□□b

单选题有以下程序:#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);}程序运行后的输出结果是(  )。A12B13C15D11

单选题a=10ifa==10:print(a-10)else:print[a]程序的输出结果是()。A0B10C-10D程序异常