-->
当前位置:首页 > 题库

PROGRAMMING:Count the number of positive and negative numbers, and then calculate the average of these numbers

Luz5年前 (2021-05-10)题库460
Write a program, input the integer without specified number, judge how many positive numbers are read in and how many negative numbers are read in, and then calculate the sum and average value of these input values (do not count 0). When the input is 0, the program ends. The average value is displayed as double data.
###Input format:
Input gives a series of integers on a line, separated by spaces. When 0 is read, it means the end of the input, and the number should not be left at any place
###Output format:
Output the number of positive integers in the first line;
Output the number of negative integers in the second line;
Output the sum of these input values in the third line (do not count 0);
In the fourth line, output the average of these input values (double data).
###Input example:
```in
1 2 -1 3 0
```
###Output example:
```out
three
one
five
one point two five
```







answer:If there is no answer, please comment