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

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<=5;i++){ cin>>a[i]; } s=(a[1]+a[2]+a[3]+a[4]+a[5]); printf("%.2lf",s) 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:14:5: error: expected ';' before 'for'
     for(int i=1;i<=5;i++){
     ^
Main.cc:14:17: error: 'i' was not declared in this scope
     for(int i=1;i<=5;i++){
                 ^