更多"下列程序的运行结果是( )。 public class Sun "的相关试题:
[单项选择]下列程序的运行结果是( )。 public class Sun { public static void main(String args[]) { int a=1; int b=1; for(int i=1;i<=3;i++) { a=a+b; b=b+a; } System.out.println(a+" "+B) ; } }
A. 6 6
B. 5 8
C. 13 21
D. 34 55
[单项选择]下列程序的运行结果是______。
Public class sun
Public static void main (String args[])
int x=4, y=0;
if (Math. pow (x, 2)==16)
y=x;
if (Math. pow (x, 2)<15)
y=1/x;
if (Math. pow (x, 2)>15)
y=(int)Math. pow (x, 2)+1;
system. out. println(y);
A. 4
B. 17
C. 18
D. 0.25
[单项选择]下面程序的输出结果是( )。 public class Sun { public static void main (String args[ ]) { int x=0; for (int i=1; i<=4; i++) { x=4; for (int j=1; j<=3; j++) { x=3; for(int k=1;k<=2;k++) { x=x+6; } } } System.out.println (x); } }
A. 7
B. 15
C. 157
D. 538
[单项选择]下面程序的运行结果是( )。
public class Test
public static void main (String args[])
int c=5;
System. out. println (c);
System. out. println (c++);
System. out. println (c);
A. 5
B. 5
C. 6
D. 6
[单项选择]以下程序的运行结果为( )。 public class Sun { public static void main(String args[]) { String x="A",y="B",z="C"; for(int m=1;m<=2;m++) { x=y; y=z; z=x; } System.out.println(x+y+z); } }
A. ABC
B. BCA
C. BCB
D. CBC
[单项选择]下列程序的运行结果是( )。
Public class sun
Public static void main(String args[])
int x=4,y=0;
if(Math.pow(x,2)==16)
y=x;
if(Math.pow(x,2)<15)
y=1/x;
if(Math.pow(x,2)>15)
y=(int)Math.pow(x,2)+1;
system.out.println(y);
A. 4
B. 17
C. 18
D. 0.25
[单项选择]下列程序的运行结果是( )。
public class Sun
public static void main(String args[])
int a=1;
int b=1;
for(int i=1;i<=3;i++)
a=a+b;
b=b+a;
System.out.println(a+" "+B) ;
A. 6 6
B. 5 8
C. 13 21
D. 34 55
[单项选择]执行下面程序后输出的正确结果是
Public class Test
public static void main(String args[])
byte x=3,y=4;
long r=80L;
System.out.print(r/y);
System.out.print(”,”);
System.out.print(x/y);
A. 20.0,1
B. 20.0,1.0
C. 20,0
D. 20,1.0