Tuesday, August 19, 2014

COJ 1297. Divisibility by 495

495=5*9*11 which means that if the number is divisible by 5 and 9 and 11 at the same time then the number is divisible on 495. The constraints are big which means we need to input the number as a string. So the divisibility rules
5: if the number's last digit is either 5 or 0.
9: If the number's sum of digits is divisible on 9.
11. If the difference of sums on the even and odd indexed digits is divisible on 11.


       FULL SOURCE CODE

No comments:

Post a Comment