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

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

下面程序段的输出结果是( )。 publicclassTest{ publicstaticvoidmain(Stringargs[]){ intx,y; x=(int)Math.sqrt(5)/2+(int)Math.random()*5/2; Y=(int)Math.sqrt(3)/2+(int)Math.random()*3/2; if(x>y) System.out.println9"x>y"); elseif(x==y) System.out.println("x=y"); else System.out.println("x<y"); } }

A.x>y

B.x=y

C.x<y

D.编译错误


参考答案

更多 “ 下面程序段的输出结果是( )。 publicclassTest{ publicstaticvoidmain(Stringargs[]){ intx,y; x=(int)Math.sqrt(5)/2+(int)Math.random()*5/2; Y=(int)Math.sqrt(3)/2+(int)Math.random()*3/2; if(x>y) System.out.println9"x>y"); elseif(x==y) System.out.println("x=y"); else System.out.println("x<y"); } }A.x>yB.x=yC.x<yD.编译错误 ” 相关考题
考题 下面程序段的输出结果是( )。 public class Test { public static void main(String args[ ]){ int x,y; x=(int)Math.sqrt(5)/2+(int)Math.random()*5/2; y=(int)Math.sqrt(3)/2+(int)Math.random()*3/2; if (x>y) System.out.println("x>y"); else if (x==y) System.out.println("x=y"); else System.out.println("x<y"); } }A.x>yB.x=yC.x<yD.编译错误

考题 下面程序的输出为( )。 public class Test { public static void main (String args[]) { int x,y; x=1; y=2; System.out.println("The output is"+x+y); } }A.The output is xyB.The output is 3C.The output is 12D.The output is x=1 y=2

考题 阅读下面程序public class Test3{public static void main(String args[]){int x=3,y=4,z=5;String s= " xyz " ;System.out.println(s+x+y+z);}}程序运行的结果是A)xyz12B)xyz345C)xyzxyzD)12xyz

考题 下面程序段的输出结果是( )。 public class Test{ public static void main(String args[]){ int X,y; x=(int)Math.sqrt(5)/2+(int)Math.random*5/2; y=(int)Math.sqrt(3)/2+(int)Math.random*3/2; if(xv) System.OUt.println("xy"); elseif(x= =y) System.out.println("x=Y"); else System.out.println("xy"): } }A.xyB.x=YC.xyD.编译错误

考题 下面程序段的输出结果是 public class Test{ public static void main(Stringargs[]){ int x,y; x=(int)Math.sqrt(5)/2+(int)Math.random()*5/2; y=(int)Math.sqrt(3)/2+(ht)Math.random()*3/2; if(x>y) System.out.println(”x>y”); else if(x=y) System.out.println(”x=y”); else System.out.Println(”x<y”); } }A.x>yB.x=yC.x<yD.编译错误

考题 下面程序段的输出结果是 public class Test{ public static void main(String args[]){ int x,y; x=(int)Math.sqrt(5)/2+(int)Math.random()*5/2; y=(int)Math.sqrt(3)/2+(iht)Math.random()*3/2; if(x>y) System.out.println("x>y"); else if (x==y) System.out.println("x=y"); else System.out.println("x<y"); } }A.x>yB.x=yC.x<yD.编译错误

考题 阅读下面程序 public class Test3 { public static void main(String args[]){ int x=3, y=4, z=5; String s="xyz"; System.out.primln(s+x+y+z); } } 程序运行的结果是A.xyzl2B.xyz345C.xyzxyzD.12xyz

考题 下面程序段的输出结果是 public class Test{ public static void main(String args[]){ int x,y; x=(int)Math.sqrt(5)/2+(int)Math.random()*5/2; y=(int)Math.sqrt(3)/2+(int)Math.random()*3/2; if(x>y) System.out.println("x>y"); else if(x==y) System.out.println("x=y"); else System.out.println("x<y"); } }A.x>yB.x=yC.x<yD.编译错误

考题 下面程序段的输出结果是______。 public class Test{ public static void main(String args[ ]){ int x,y; x=(int)Math.sqrt(5/2)+(int)Math.random( )*5/2; y=(int)Math.sqrt(3/2)+(int)Math.random( )*3/2; if(x>y) System.out.println("x>y"); else if(x==y) System.out.println("x=y"); else System.out.println("x<y"); } }A.x>yB.x=yC.x<yD.编译错误