Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
142122 左锶焜 18统计成绩 C++ Compile Error 0 MS 0 KB 611 2025-12-30 19:22:54

Tests(0/0):


Code:

#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,a[101],i,s=0,max=-1,min=100; double x; cin>>n; for(i=1;i<=n;i++){ cin>>a[i]; s+=a[i]; } x=s*1.0/n; for(i=1;i<=n;i++){ if(max<a[i]){ max=a[i]; } if(min<a[i]){ min=a[i]; } } printf("%.2lf",s,x,max,min) return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:26:31: warning: format '%lf' expects argument of type 'double', but argument 2 has type 'int' [-Wformat=]
     printf("%.2lf",s,x,max,min)
                               ^
Main.cc:26:31: warning: too many arguments for format [-Wformat-extra-args]
Main.cc:27:5: error: expected ';' before 'return'
     return 0;
     ^