- 3
1-D Array - Average me
There are N trees in Terry's front yard. He is supposed to measures the height of each tree and find the average height of trees in his yard. What is the average height of a tree in Terry's front yard? Note:- Print your answer as floor value (average height) Input The first line contains N: numbers of tree. Then follows N lines represents the height of each tree. Constraint:- 1 <= n <= 100000 1 <= a[i] <= 100000 Output Print the average height of all the trees in the yard Example Input 5 6 8 34 9 3 Output 12 Explanation:- Sum of heights =60 Average of heights =60/5 Sample Input: 3 1 2 3
3 odpowiedzi
+ 1
Ashish Kumar Maurya
Show your attempts. You have already completed course.
+ 1
I have deleted my solution for the problem, since Q&A Discussions isnt a platform for challenges, if u want to post challenges post it in feed.