- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int n;
- cin>>n;
- int point[n];
- for(int i=0;i<n;i++)
- cin>>point[i];
- sort(point,point+n);
- int l=-1,h=101;
- for(int i=0;i<n;i++)
- {
- if(i==n-1)
- cout<<point[i]<<endl;
- else
- cout<<point[i]<<" ";
- if(point[i]<60)
- l=max(l,point[i]);
- else
- h=min(h,point[i]);
- }
- if(l>=0)
- cout<<l<<endl;
- else
- cout<<"best case";
- if(h<=100)
- cout<<h<<endl;
- else
- cout<<"worst case";
- return 0;
- }
複製代碼 |