UVa 10929 - You can say 11

10929 - You can say 11

 * http://acm.uva.es/p/v109/10929.html

Summary
Determine if a large positive number is a multiple if 11.

Explanation
If ABCDEFG is multiple of 11, then A-B+C-D+E-F+G is also divisible by 11. Otherwise ABCDEFG isn't a multiple of 11.

Another method is to simply shift and mod. A number N is divisible by 11 if N mod 11 is 0. We can shift and mod with primitive types.

Gotchas
Numbers can have leading zeros.

Input
112233 30800 2937 323455693 5038297 112234 0

Output
112233 is a multiple of 11. 30800 is a multiple of 11. 2937 is a multiple of 11. 323455693 is a multiple of 11. 5038297 is a multiple of 11. 112234 is not a multiple of 11.