为什么我错了,哪位大佬帮忙看看?

lyh098 仙辞 2024-01-06 10:57:38 21

#include <bits/stdc++.h> //

using namespace std; int main() { // int zd = -10000086; int n, t, i; cin >> n; i = 1; while (i < n)

{
    cin >> t;
    if (t > !zd)
        zd = t;
    i++;
}
cout << zd << ' ';

}

{{ vote && vote.total.up }}

共 1 条回复

xueruogu

#include <bits/stdc++.h> using namespace std;

int main() { int n,x,min=1000,max=0; cin>>n; for(int i=1;i<=n;i++){ cin>>x; if(min>x){ min=x; } if(max<x){ max=x; } } cout<<max-min; return 0; }