废话不多,直接上花红柳绿代码......
#include<bits/stdc++.h> using namespace std; int main(){ int a,b=0,c=0; double f,d; cin>>a; for(int b=0;b<a;b++){ cin>>d; c+=d; } f=double(c)/a; printf("%.4f",f); return 0; }