PAT 1012. Digit Classification (20)_Stella-Chen’s Blog
class=”markdown_views prism-atom-one-dark”> Overview of the topic: Given a series of positive integers, please classify the numbers as required, and output the following 5 numbers: A1 = Among the numbers divisible by 5 The sum of all even numbers; A2 = The numbers with a remainder of 1 after division by 5 are interleaved and summed in the given order, that is, calculating n1-n2+n3-n4…; A3 = The remainder of 2 after division by 5 The number of digits; A4 = the average number of numbers with a remainder of 3 after division by 5, accurate to 1 decimal place; A5 = the largest number of numbers with a remainder of 4 after division by 5. Input format: Each input contains 1 test case. Each test case first gives a positive integer N not exceeding 1000, and then gives N positive integers not exceeding 1000 to be classified. Numbers are separated by spaces. Output format: For the given N positive integers, calculate A1~A5 according to the title and output them sequentially in one line. Numbers are separated by spaces, but there must be no extra spaces at the end of the line. If one of the numbers does not exist, then output…