#include <iostream>
#include <windows.h>
#include <string>
using namespace std;
float averageSalary(int n[],int i) {
    float sum = 0;
    for (int x = 0; x < i; x++) {
        sum += n[x];
    }return sum/i;
}
int main() {
    int salary[] = {
        2300,3000,1888,5000,6000,6200
    };
    cout << averageSalary(salary, 6) << endl;

    system("pause");
    return 0;
}

 

posted on 2022-08-28 15:45  wshidaboss  阅读(42)  评论(0编辑  收藏  举报