Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
5284 柯宇希 18统计成绩 C++ Compile Error 0 MS 0 KB 525 2024-11-09 14:38:38

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,D=100,G=-1,a[110]; double tot,ave cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; tot+=a[i]; if(G<a[i]) G=a[i]; if(D>a[i]) D=a[i]; } ave=tot/n; printf("%.0lf %.2lf %d %d\n",tot,ave,G,D) return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:10:5: error: expected initializer before 'cin'
     cin>>n;
     ^
Main.cc:17:5: error: 'ave' was not declared in this scope
     ave=tot/n;
     ^
Main.cc:19:5: error: expected ';' before 'return'
     return 0;
     ^