6、If x and y are integers and xy<>0, what is the remainder when x is divided by y?
(1) when x is divided by 2y, the remainder is 4;
(2) when x+y is divided by y, the remainder is 4;
【答案】B
【思路】(1)X=2Y*K+4 举反例:当Y=4,X=4时,X/Y的余数为0。当Y=3,X=10时,X/Y的余数为1. (2)X+Y=Y*K+4 则X=(K-1)Y+4, 所以X/Y的余数为4
有点想不通,如果说(1)Y=4,X=4,余数为0,那么(2)举反例时也可以Y=4,X=4.余数为0,所以应该是E啊,想不通啊想不通,请明白的筒子赐教呵~~
举报
这是狒狒6里的原题,我也不明白,直接忽略掉这个条件了
楼主反例举的不妥,if y=x=4, how can u say when x+y is divided by 4,remainder is 4??
发表回复
手机版|ChaseDream|GMT+8, 2025-10-24 20:22 京公网安备11010202008513号 京ICP证101109号 京ICP备12012021号
ChaseDream 论坛
© 2003-2025 ChaseDream.com. All Rights Reserved.