3 solutions

  • 1
    @ 2024-1-13 9:53:01

    #include #include using namespace std; int a[20]; int main(){ int n; cin>>n; for(int i=0;i<n;i++) cin>>a[i]; sort(a,a+n); //排序,最大的数在最后边 cout<<a[n-1]; //下标从0开始所以最后一个元素的下标是n-1 return 0; }

    Information

    ID
    551
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    3
    Tags
    # Submissions
    21
    Accepted
    18
    Uploaded By