以下代码段执行后的输出结果为( )

int x=3; 
int y=10;
System.out.println(y%x);

  

A.0
B.1
C.2
D.3

参考解答

B % 取余符号。y/x = 10/3 = 3 余数是1,所以选B


results matching ""

    No results matching ""