1-Review:
Given an array of integers, calculate the fractions of its elements that are positive, negative, and are zeros. Print the decimal value of each fraction on a new line.
2-Explanation:
There are 3 positive numbers, 2 negative numbers, 1 and zero in the array. The proportions of occurrence are positive: 3/6 = 0.500000, negative:2/6 = 0.333333 and zeros: 1/6 = 0.166667 .
3-Input Format
The first line contains an integer, denoting the size of the array. The second line contains space-separated integers describing an array of numbers .
4-Output Format
You must print the following 3 lines:
- A decimal representing of the fraction of positive numbers in the array compared to its size.
- A decimal representing of the fraction of negative numbers in the array compared to its size.
- A decimal representing of the fraction of zeros in the array compared to its size