40分,求助!
查看原帖
40分,求助!
713504
dongBAO1210楼主2024/11/21 12:48
#include<bits/stdc++.h>
using namespace std;
double a[1000000];
int main(){
	double n; 
	double s = 0;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		s+=a[i];
	}
	cout<<s<<" ";
	s=s/n;
	printf("%.5f",s);
	return 0;
} 	
2024/11/21 12:48
加载中...