Bessie's teacher hates calculating the cow's grades but loves typing numbers into a computer, however ineptly. Help her figure out each student's average grade while ignoring those grades with typing errors.
Bessie's teacher hates calculating the cow's grades but loves typing numbers into a computer, however ineptly. Help her figure out each student's average grade while ignoring those grades with typing errors. The input file has N (1 <= N <= 100) grades (-100 <= grade <= 100). Any grade that is 0 or below is a typographical error which should be treated as if it didn't exist at least as far as calculating the mean (i.e., ignore the input and do not count that grade when calculating the mean). The mean of a group of numbers is the sum of those numbers divided by the number of numbers. Printing numbers with decimal places is problemmatic, so just multiply the mean by 10 and round it by adding 0.5 before converting it to an integer. Every dataset has at least one proper grade in it.
标签: HBC25068PokémonGo[USACO 2007 Mar L]Classroom Statistics题解