Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
118980 唐诗阳 计算平均数 C++ Compile Error 0 MS 0 KB 402 2025-05-11 15:35:43

Tests(0/0):


Code:

#include<iostream> #include<cstdio> //scanf()\printf() #include<cstring> #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int a[6]; double s; for(int i=1;i<=n;i++){ cin>>a[i]; } s=(a[1]+a[2]+a[3]+a[4]+a[5]); for(int i=1;i<=5;i++){ if(a[i]>s) cout<<a[i]<<' '; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:9:20: error: 'n' was not declared in this scope
     for(int i=1;i<=n;i++){
                    ^