#34800: _c++


qqazwwsxeedcrrfvttgb@gmail.com (Jackis666)

學校 : 嘉義市私立輔仁高級中學
編號 : 226198
來源 : [39.9.66.12]
最後登入時間 :
2025-08-08 13:23:15

#include<bits/stdc++.h>
using namespace std;
int main(){
    int size;
    cin>>size;
    int ptr[size];
    for(int i;i<size;i++)
        cin>>ptr[i];
    sort(ptr,ptr+size);
    for(int i=0;i<size;i++)
        cout<<ptr[i]<<" ";
    int low=101,high=-1;
    for(int i=0;i<size;i++){
        if(ptr[i]>=60 and ptr[i]<low)
            low=ptr[i];
        if(ptr[i]<60 and ptr[i]>high)
            high=ptr[i];
    }
    if(low==101)
        cout<<"\n"<<high<<"\nworst case";
    else if(high==-1)
        cout<<"\nbest case"<<"\n"<<low;
    else
        cout<<"\n"<<high<<"\n"<<low;
    return 0;
}