Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
5282 张文曦 18统计成绩 C++ Compile Error 0 MS 0 KB 614 2024-11-09 14:37:53

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,z=0,p,a[101],d=INT_MIN,x=INT_MAX; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } for(int i=1;i<=n;i++){ z=z+a[i]; } p=z/n; for(int i=1;i<=n;i++){ if(a[i]>d) d=a[i]; } for(int i=1;i<=n;i++){ if(a[i]<x) x=a[i]; } cout<<z<<endl<<p<<endl<<d<<endl<<x; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:8:26: error: 'INT_MIN' was not declared in this scope
     int n,z=0,p,a[101],d=INT_MIN,x=INT_MAX;
                          ^
Main.cc:21:17: error: 'x' was not declared in this scope
         if(a[i]<x) x=a[i];
                 ^
Main.cc:23:38: error: 'x' was not declared in this scope
     cout<<z<<endl<<p<<endl<<d<<endl<<x;
                                      ^