#include<iostream>
#include<list>
#include<cstdio>
using namespace std;
int main()
{
freopen("in.txt","r",stdin);
int k;
cin>>k;
list<int> lst;
int x;
while(cin>>x&&x>=0){
lst.push_back(x);
}
list<int>::iterator itr1=lst.begin(),itr2=lst.begin();
while(k&&itr2!=lst.end()){
++itr2;
k--;
}
if(k!=0){
cout<<"NULL"<<endl;
return 0;
}
while(itr2!=lst.end()){
++itr1;++itr2;
}
if(itr1==lst.end()){
cout<<"NULL"<<endl;
}else{
cout<<*itr1<<endl;
}
}
305
最新推荐文章于 2023-11-22 14:51:50 发布