Easy10 pts
Plus Minus
Given an array, calculate the ratios of positive, negative, and zero elements. Print each on a new line with 6 decimal places.
Input
Line 1: n. Line 2: n space-separated integers.
Output
Three lines: ratio of positive, negative, zero (6 decimals each).
Sample
6 -4 3 -9 0 4 1
Expected
0.500000 0.333333 0.166667
Loading editor…
Output
No output yet. Run your code to see results.