11题是怎么做得有人能解答一下吗?
PS x+y divided by 5 remainder is 1; x+z divided by 5 remainder is 2; y+z divided by 5 remainder is 3 求 x+y+z divided by 5 remainder? 余3
momo_s 发表于 2017-9-27 18:26
11题是怎么做得有人能解答一下吗?
PS x+y divided by 5 remainder is 1; x+z divided by 5 remainder is 2 ...
余数有可以相加减乘除的特性 就是说 如果 x mod 5 =1, y mod 5=2的话 那么 (x+y) mod 5 = 1+2
相乘也一样 x mod 5= 2; y mod 5 = 2 那么 (x*y) mod 5 = 2*2 =4
我的思路是把 3个条件相加 得到 2* (x+y+z) mod 5 = (2 mod 5) * ((x+y+z) mod 5) =1+2+3 = 6
而 2 mod 5 = 2; 所以 (x+y+z) mod 5 = 3 酱紫