Run ID:148394
提交时间:2026-02-12 20:27:06
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n; cin>>n; int cj[100] = {}; double z=0,p=0,zd=0,zx=111111,s = 0; for(int i = 1;i <= n;i++){ cin>>cj[i]; z += cj[i]; } for(int i = 1;i <= n;i++){ if(cj[i]>zd){ zd = cj[i]; }if(cj[i]<zx) zx = cj[i]; } cout<<z<<" "; cout<<fixed<<setprecision(2)<<z/n<<" "; cout<zd<<" "; cout<<zx; return 0; }