更多"下面程序段的运行结果是 void main ( ) int "的相关试题:
[单项选择]下面程序段的运行结果是
void main ( )
int t, a, b, C;
a=1;b=2;C=2;
while(a<b<c)
t=a;a=b;b=t;c--;
cout < < a < < "," < < b < < "," < < C;
A) 1,2,0 B) 2,1,0 C) 1,2,1 D) 2,1,1
[单项选择]下面程序段的输出结果是
classTest
public static void main(Stringargs[])
MyThread t=new MyThread( );
t.displayOutput(”t has been createD) ”);
t.start( );
Class MyThread extends Thread
public void displayOutput(Strings)
System.out.println(S);
public void run( )
displayOutput(”t is running.”);
A. thas been created.
B. thas been created
C. t is running.
D. 编译出错
[单项选择]下面程序段的输出结果是 class Test{ public static void main(String args[]){ MyThread t=new MyThread( ); t.displayOutput("t has been createD) "; t.start( ); } } class MyThread extends Thread{ public void displayOutput(String s){ System.out.println(s); } public void nm( ){ displayOutput("t is running. "); }
A. t has been create t is runnin
B. t has been create
C. t is runnin
D. 编译出错
[填空题]以下程序运行后输出的结果是______。
void main( )
int x=15;
while(x>10&&x<50)
x++;
if(x/3) x++;break;
else continue,
printf("%d/n",x);
[填空题]以下程序运行后的输出结果是______。
void main( )
int p=30;
printf("%d/n",(p/3>0 p/10:p% ));
[填空题]以下程序运行后输出的结果是______。
void main( )
int a,b,c;
a=10;b=20;c=(a%b<1)||(a/b>1);
printf("%d %d %d/n",a,b,c);
[填空题]以下程序运行后输出的结果是______。
void main( )
int a=2,b=7,c=5;
switch (a>0)
case 1:switch (b<0)
case 1:printf(" @ ");
break;
case 2:printf(" !");
break;
case 0: switch (c==5)
case 0:printf("*");
break;
case 1:printf("#");
break;
default:printf("#");
break;
default:printf("&");
printf ("/n");
[填空题]下列程序段的输出结果是 [7] 。
#include<iostream.h>
void main( )
int i=10,sum=0;
do
sum=+sum+i;
i=i-2;
while(i>=2);
cout<<sum<<end1;
[填空题]以下程序的运行结果是______。
void main( )
int a=4,b=8,c;
c=(a/b==a)&&(a+b!=20);
printf("%d,%d,%d/n",a,b,c);
[填空题]以下程序运行后输出的结果是______。
void main( )
int a=1,b=2,c=3;
if(c=a,b<c) printf("%d/n",c);
else printf("%d/n",b);
[填空题]以下程序运行后输出的结果是______。
void main( )
int a=3,b=4,c=5,t=99;
if(b<a&&a<c)t=a;a=c;c=t;
if(a<c&&b<c)t=b;b=a;a=t;
printf("%d%d%d/n",a,b,c);
[单项选择]下面程序的运行结果是
#include<iostream.h>
Void main( )
int num=1;
int &ref=num;
ref=ref+2;
cout < < num;
num=num+3;
cout < < ref < <endl;
A) 13 B) 16 C) 36 D) 33
[单项选择]下面程序的运行结果是
#include<iostream.h>
void main( )
int i=1;
while(i<=8)
if(++i%3!=2)continue;
else cout < < i;
A. 25
B. 36
C. 258
D. 369