提交时间:2023-02-03 16:38:34

运行 ID: 68251

#include<bits/stdc++.h> using namespace std; int minNumInArray(int a[],int n){ int s=200; for(int i=1;i<=n;i++){ if(a[i]<s) s=a[i]; } return s; } int main(){ int t; cin>>t; while(t--){ int n,a[20]; cin>>n; for(int i=1;i<=n;i++) cin>>a[i]; int minNum=minNumInArray(a,n); int a1[20],a1s=0; for(int i=1;i<=n;i++) if(a[i]!=minNum) a1[++a1s]=a[i]; minNum=minNumInArray(a1,a1s); if(minNum==200) cout<<"NO"<<endl; else cout<<minNum<<endl; } return 0; }