HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Repetition (Loops) > problem:


145. 50656 - Divisibility by 11

Guest
• Review clarifications (2)

Volume problems

• 065. 50394 - Water Bills
• 070. 50465 - How many students h...
• 075. 50363 - Class GPA Average
• 085. 50333 - Series of Squares
• 095. 50651 - Largest power of two
• 130. 50440 - Call Center
• 135. 50392 - How much space
• 140. 50655 - Divisibility by 9
• 145. 50656 - Divisibility by 11
• 160. 50546 - Average Fuel Price
• 50338 - Convert Into Decimal
• 180. 50343 - The number of Ending...

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Prepared by Ibrahim Mesecan.

Divisibility by 11

Shqip

A number is divisible by 11, if the difference between sum of odds digits and sum of even digits is 0 or a multiple of 11.
For example:
     34871903 (The number)
     3+8+1+0=12 (sum of odd digits)
     4+7+9+3=23 (sum of even digits)
     23-12=11 (the difference)
  The number is divisible by 11.
  Write a program that reads a number up to 1000 digits and finds out if the number is divisible by 11 or not.

Input specification
The first digit is non zero digit and the number has upto 1000 digits in one line ending with a semicolon (;)

Output specification
Say "YES" if the number is divisible by 11, "NO" otherwise.

Sample Input I     
5940;    

Sample Output I
YES
Sample Input II
10000000000000000000001;

Sample Output II
NO

Для отправки решений необходимо выполнить вход.

www.contester.ru