Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
5113 柯宇希 求点积 C++ Compile Error 0 MS 0 KB 293 2024-11-02 14:41:44

Tests(0/0):


Code:

using namespace std; int main(){ int a[5],s=0; for(int i=0;i<5;i++){ cin>>a[i]; s+=a[i]; } double average=s/5.0; printf("%.2lf\n",average); for(int i=0;i<5;i++){ if(a[i]>average) cout<<a[i]<<" "; } return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:9: error: 'cin' was not declared in this scope
         cin>>a[i];
         ^
Main.cc:10:29: error: 'printf' was not declared in this scope
     printf("%.2lf\n",average);
                             ^
Main.cc:13:13: error: 'cout' was not declared in this scope
             cout<a[i]<<" ";
             ^