提交时间:2019-12-13 20:35:17
运行 ID: 3085
#include<iostream> using namespace std; int main(){ int ey; int youku[111]; cin>>ey; for(int E=1;E<=ey;E++){ cin>>youku[E]; } for(int x=1;x<=ey;x++){ for(int y=1;y<=ey-1;y++){ if(youku[y]>youku[y+1]){ int suy; suy=youku[y]; youku[y]=youku[y+1]; youku[y+1]=suy; } } } int rrr,trr=0; for(int eee=1;eee<=ey;eee++){ if(youku[eee]==eee){ rrr=youku[eee]; trr=1; break; } } switch(trr){ case 0:cout<<"N";break; case 1:cout<<rrr;break; } return 0; }