HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Repetition (Loops) > problem:


145. 50656 - Divisibility by 11

Guest
• Review clarifications (2)

Volume problems

• 118. 50514 - Bookkeeping
• 120. 50426 - Calculating Sales
• 125. 50484 - Number Of Letters
• 130. 50440 - Call Center
• 132. 50504 - School contest
• 135. 50392 - How much space
• 136. 50443 - Dajte Express
• 140. 50655 - Divisibility by 9
• 145. 50656 - Divisibility by 11
• 147. 50553 - Divisible by m
• 148. 50596 - Your Ride Is Here (US...
• 148. 50596 - Your Ride Is Here (US...
• 150. 50763 - Valid Password
• 151. 50560 - Max Distance
• 153. 50368 - Right-most non zero d...
• 155. 50379 - a^b modulus k
• 158. 50404 - Sum of Self Powers

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