下面程序段的输出结果是( )。 public class Test { public static void main(String args[ ]){ int x,y; x=(int)Mat

admin2013-03-01  25

问题 下面程序段的输出结果是(    )。      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>y
B、x=y     
C、x<y
D、编译错误

答案1

解析
转载请注明原文地址:https://kaotiyun.com/show/Ew2p777K
0

最新回复(0)