1 条题解

  • 0
    @ 2024-11-5 10:46:14

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

    int oushu(int x) { if(x%2==0) return x; else return -1; }

    int main() { int n;

    cin>>n;
    
    int a[1005];
    
    int biggest=-1;
    
    for(int i=1; i<=n; i++)
    {
    	cin>>a[i];
    	
    	biggest=max(biggest,oushu(a[i]));
    

    // cout<<"最大值:"<<biggest<<endl; }

    cout<<biggest;
    
    return 0;
    

    }

    • 1

    信息

    ID
    242
    时间
    1000ms
    内存
    256MiB
    难度
    3
    标签
    递交数
    243
    已通过
    124
    上传者