3063: 函数-求数组平均值
Memory Limit:128 MB
Time Limit:1.000 S
Judge Style:Text Compare
Creator:
Submit:18
Solved:15
Description
定义函数float avgArray(int arr[], int len),计算整型数组的平均值并返回。主函数输入数组长度和数组元素,调用该函数输出平均值(保留 2 位小数)。
Input
第一行输入数组长度 n,第二行输入 n 个整数
Output
平均值(保留 2 位小数)
Sample Input Copy
3 1 2 3
Sample Output Copy
2.00
HINT
n ∈ [1, 100],数组元素 ∈ [-1000, 1000]