标签:iostream ++ n+1 输入 print 0ms bsp main return
读入n(1 <= n <= 10000)个整数,求它们的和与均值。
4 344 222 343 222
1131 282.75000
#include <iostream>
using namespace std;
int main (){
int n,a;
int sum=0;
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d",&a);
sum +=a;
}
printf("%d %.5f",sum,double(sum)/n);
return 0;
}
标签:iostream ++ n+1 输入 print 0ms bsp main return
原文地址:https://www.cnblogs.com/geyang/p/12330706.html