-7 java loops input moving-average
几乎没有Java问题:
方案如下:让用户在数组中输入10个数字.然后遍历数组并对其进行平均.然后再次遍历数组并将每个值与平均值进行比较,如果它低于用户输入的10个数字的平均值,则打印数字(和/或循环索引).
Read the array.
Calculate the average.
Loop through the array
check if it has value less than average
if yes print the index
if no check for the next
Run Code Online (Sandbox Code Playgroud)