FIRST CONTROLExtensions national teamHaskovo, May 9, 2011Group ATask A3. BALANCED NUMBERSAuthor: Krasimir GeorgievA positive integer called balanced if every even number indecimal his record occurs odd number of times, and every odd number occurs evennumber of times.For example 77, 211, 6222 are balanced numbers, 351, 21 and 662 are not.Write a program balanced, which is the number of balanced numbers ingiven interval.InputFrom standard input two positive integers a and b (a ≤ b),separated by a space, representing the ends of the interval.ExitOn the standard output an integer number of c- balanced numbersn at the interval [a, b] (i. e. a ≤ n ≤ b).Limitationsa ≤ b ≤ 1019Time: 4 seconds.Example:Input1 1000Exit147
đang được dịch, vui lòng đợi..