#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
struct cj
{
char name[10];
int y;
int s;
int e;
int t;
};
int main()
{
int n;
scanf("%d",&n);
struct cj xuan[1001];
for(int i=0; i<n; i++)
{
scanf("%s %d %d %d",xuan[i].name,
&xuan[i].y, &xuan[i].s,&xuan[i].e);
xuan[i].t = xuan[i].y + xuan[i].s + xuan[i].e;
}
for(int i = 0; i < n ; i++)
{
for(int j = i+1; j<n; j++)
{
if(abs(xuan[i].t - xuan[j].t) <= 10
&& abs(xuan[i].y - xuan[j].y) <= 5
&& abs(xuan[i].s - xuan[j].s) <= 5
&& abs(xuan[i].e - xuan[j].e) <= 5)
printf("%s %s\n",xuan[i].name, xuan[j].name);
}
}
return 0;
}
洛谷 旗鼓相当的对手加强版 C
最新推荐文章于 2024-08-22 21:24:01 发布