#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
struct E
{
char name[27];
int tall;
}s[1007];
int cmp(E a,E b)
{
return a.tall<b.tall;
}
int main()
{
E s[107];
int n,i,a,downt,upt,f=0;
scanf("%d",&n);
a=n;
for(i=0;i<n;i++)
{
scanf("%s",&s[i].name);
scanf("%d",&s[i].tall);
}
sort(s,s+a,cmp);
scanf("%d%d",&downt,&upt);
for(i=0;i<a;i++)
{
if(s[i].tall>=downt&&s[i].tall<=upt)
{
f++;
printf("%s %d\n",s[i].name,s[i].tall);
}
}
if(f==0)
{
printf("No\n");
}
return 0;
}
/***************************************************
User name: TJRAC6015203228魏杰
Result: Accepted
Take time: 0ms
Take Memory: 108KB
Submit time: 2016-10-31 22:07:55
****************************************************/
sdut1595选夫婿2
最新推荐文章于 2021-09-04 23:09:20 发布