Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
146367 张宇泽 最大值与最小值的差 C++ Compile Error 0 MS 0 KB 245 2026-01-28 12:01:06

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int b,a[10000],max,min; cin>>b; cin>>a[0]; min=max=a[0]; for(int i=1;i<b;i++){ cin>>a[0]; if(a>max)max=a[0]; if(a<min)min=a[0]; } cout<<max-min; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:10:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   if(a>max)max=a[0];
        ^
Main.cc:11:8: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   if(a