提交时间:2023-02-02 14:11:44
运行 ID: 68090
#include <bits/stdc++.h> using namespace std; int small,nums[11],bignums[11],num,c,n; int main(){ cin>>c; while(c--){ cin>>n; small=101; for(int i=0;i<n;i++){ cin>>nums[i]; if(nums[i]<small) small=nums[i]; } int a=0; for(int i=0;i<n;i++) if(nums[i]!=small) bignums[a++]=nums[i]; small=101; for(int i=0;i<a;i++){ if(bignums[i]<small) small=bignums[i]; } if(small!=101) cout<<small<<endl; else cout<<"NO"<<endl; } return 0; }