Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
38843 | 奚晨瑞 | 求整数的和与均值 | C++ | Accepted | 1 MS | 244 KB | 218 | 2024-01-28 17:18:10 |
#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; }