40分,求助!!!
查看原帖
40分,求助!!!
991994
20130423dzx楼主2024/2/28 21:07
#include <bits/stdc++.h>
using namespace std;
double a;
double b, c = 0, d;

int main () {
	cin >> a;
	for (int i = 1; i <= a; i++) {
		cin >> b;
		c += b;
	}
	d = c / a;
	cout << c;
	cout << fixed << setprecision(5) << " " << d;
	return 0;
}
2024/2/28 21:07
加载中...