I have to read numbers from std input and if there are no positive elements I need to print "Ave. = 0.00". Let's say the inputs are going to be "1 2 4 -3 -6 6". Now if an input has no positive integer like the example before, I need to print "Ave. = 0.00". I am a newbie and not sure how to proceed. Appreciate the help!
You don't say what happens when the input contains both positive and negative values.
Usually, even with integer inputs, you calculate the average as a floating point value. Use two variables, a total (type double) and a count (type int). The average (type double) is simply total/count.
One more thing, to print out to two decimal places, you might do