Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
5101 黄宜洋 找最大的数 C++ Compile Error 0 MS 0 KB 515 2024-11-02 14:27:14

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 a[10]; int maxn=INT_MIN,pos=0; for(int i=0;i<10;i++){ cin>>a[i]; } for(int i=0;i<10;i++){ if(a[i]>maxn){ maxn=a[i]; pos=i+1; } } printf("%d\n",pos); return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:9:14: error: 'INT_MIN' was not declared in this scope
     int maxn=INT_MIN,pos=0;
              ^
Main.cc:16:13: error: 'pos' was not declared in this scope
             pos=i+1;
             ^
Main.cc:19:19: error: 'pos' was not declared in this scope
     printf("%d\n",pos);
                   ^