Final answer:
To solve this problem, you need to read the input values, calculate the average of the numbers in the vector, and output the numbers that are less than the average.
Step-by-step explanation:
To solve this problem, you need to follow these steps:
- Read the value of nummembers from the input.
- Create a vector called idlogs with a size of nummembers.
- Use a loop to read nummembers elements from the input and store them in idlogs.
- Calculate the average of the numbers in idlogs by adding them up and dividing by the size of idlogs.
- Initialize a variable called count to 0.
- Use another loop to access each element in idlogs.
- Inside the loop, check if the element is less than the average.
- If it is, output the element followed by a space and increment count by 1.
Finally, output the average and the count of numbers less than the average.
For example, if the input is: 4 154 188 144 43, the output would be: Average: 132 and Numbers less than average: 43.