#34800: c++


qqazwwsxeedcrrfvttgb@gmail.com (Jackis666)

學校 : 嘉義市私立輔仁高級中學
編號 : 226198
來源 : [42.73.47.160]
最後登入時間 :
2023-07-22 13:59:09
b964. 1. 成績指標 -- 2016年3月apcs | From: [163.27.10.252] | 發表日期 : 2023-04-17 18:58

#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;
}

 
ZeroJudge Forum