为什么这道题不能用while
查看原帖
为什么这道题不能用while
971088
pgmli楼主2024/8/24 18:28
#include <bits/stdc++.h>
using namespace std;

int n;
double sum;

int main()
{
	cin >> n;
	while(n --)
	{
		int age;
		cin >> age;
		sum += age;
	}
	printf("%.2lf", sum / n);
	
	return 0; 
}
2024/8/24 18:28
加载中...