Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
6757 谢锦卓 最大值与最小值的差 C++ Wrong Answer 0 MS 256 KB 512 2025-03-15 10:33:26

Tests(0/10):


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[10001],m; cin>>m; int x=-10001,n=10001; for(int i=1;i<=x;i++){ cin>>a[i]; if(a[i]>x){ n=a[i]; } if(a[i]>n){ x=a[i]; } } cout<<x-n<<endl; return 0; }


Run Info:

------Input------
85 502 229 163 67 153 298 445 425 553 131 545 51 172 953 674 525 409 614 907 945 764 88 587 369 666 485 967 567 957 759 439 704 770 562 660 22 344 651 375 246 140 444 214 538 531 981 131 103 247 373 485 41 134 714 291 557 159 661 830 351 959 801 718 990 115 365 8 701 351 680 7 691 494 53 497 133 331 240 27 67 583 439 191 520 520
------Answer-----
983
------Your output-----
-20002