每日一练:计算机二级考试Java每日一练(2018/4/21)
【单选题】下面程序段的输出结果是()。
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>v)
System.OUt.println("x>y");
elseif(x==y)
System.out.println("x=Y");
else
System.out.println("x }
}
A.x>y
B.x=Y
C.x
D.编译错误
在下面提交答题后即可查看答案与试题解析
发布评论 查看全部评论