Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
5262 柯宇希 最大值与最小值的差 C++ Compile Error 0 MS 0 KB 449 2024-11-09 14:17:58

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 m,a[10010]; int main(){ cin>>m; for(int i=1;1<=m;i++){ cin>>a[i]; if(maxn<a[i]) maxn=a[i]; if(m1nn<a[i]) minn=a[i]; } cout<<maxn-minn<<endl; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:12:12: error: 'maxn' was not declared in this scope
         if(maxn<a[i]) maxn=a[i];
            ^
Main.cc:13:12: error: 'm1nn' was not declared in this scope
         if(m1nn<a[i]) minn=a[i];
            ^
Main.cc:13:23: error: 'minn' was not declared in this scope
         if(m1nn<a[i]) minn=a[i];
                       ^
Main.cc:15:11: error: 'maxn' was not declared in this scope
     cout<<maxn-minn<<endl;
           ^
Main.cc:15:16: error: 'minn' was not declared in this scope
     cout<<maxn-minn<<endl;
                ^