Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
118139 何睿函 最大值与最小值的差 C++ Wrong Answer 1 MS 264 KB 444 2025-04-24 19:02:02

Tests(0/10):


Code:

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


Run Info:

------Input------
97 843 971 510 735 8 532 745 842 224 482 828 294 117 859 288 640 852 958 326 117 119 632 60 774 652 220 789 538 716 864 205 388 454 566 766 927 980 857 572 391 31 89 808 506 679 768 763 286 701 261 41 109 5 353 984 863 646 305 289 30 236 195 222 360 543 732 909 208 125 865 356 438 310 980 805 120 911 418 292 609 465 843 919 306 274 370 429 702 221 294 506 378 702 223 218 876 876
------Answer-----
979
------Your output-----
559939580