Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
123646 王梓轩 找最大的数 C++ Compile Error 0 MS 0 KB 600 2025-07-08 11:34:11

Tests(0/0):


Code:

#include<iostream> using namespace std; int main() { int max=0,z,a[15] for(int i=1;i<=10;i++) { cin>>a[i]; } for(int i=1;i<=10;i++) { if(a[i]=max) { max=a[i]; z=i; } } cout<<z; return 0; } #include<iostream> using namespace std; int main() { int max=0,z,a[15] for(int i=1;i<=10;i++) { cin>>a[i]; } for(int i=1;i<=10;i++) { if(a[i]=max) { max=a[i]; z=i; } } cout<<z; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:5: error: expected initializer before 'for'
     for(int i=1;i<=10;i++)
     ^
Main.cc:6:17: error: 'i' was not declared in this scope
     for(int i=1;i<=10;i++)
                 ^
Main.cc:12:12: error: 'a' was not declared in this scope
         if(a[i]=max)
            ^
Main.cc: In function 'int main()':
Main.cc:23:5: error: redefinition of 'int main()'
 int main()
     ^
Main.cc:3:5: note: 'int main()' previously defined here
 int main()
     ^
Main.cc:26:5: error: expected initializer before 'for'
     for(int i=1;i<=10;i++)
     ^
Main.cc:26:17: error: 'i' was not declared in this scope
     for(int i=1;i<=10;i++)
                 ^
Main.cc:32:12: error: 'a' was not declared in this scope
         if(a[i]=max)
            ^