UVa 10929 - You can say 11

10929 - You can say 11

 * [ ]

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 (similar to long-division on pen and paper) is to read digits one-by-one, and apply the modulus; this will work on any arbitrary number, while using primitive types. A number N is divisible by 11 if the final digit results in no remainder.

Gotchas
Numbers can have leading zeros.

Solutions

 * Code All the Problems

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.