提交时间:2024-02-16 00:16:11

运行 ID: 40699

#include<iostream> using namespace std; int main() { float n,num,S; S=0; cin>>n; int i=n; while(i>0){ cin>>num; S+=num; i-=1; } float T=S/n; cout<<S<<" "; printf("%.5f",T); return 0; }