题目:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=114355#problem/A
代码:
#include<stdio.h>
#include<string.h>
using namespace std;
struct node
{
int x;
int y;
} q[205];
int main()
{
int t;
scanf("%d",&t);
for(int i=0; i<t; i++)
{
scanf("%d %d",&q[i].x,&q[i].y);
}
int ans=0;
for(int i=0; i<t; i++)
{
int a=0,b=0,c=0,d=0;
for(int j=0; j<t; j++)
{
if(i!=j)
{
if(q[i].x>q[j].x&&q[i].y==q[j].y)
{
a=1;
}
else if(q[i].x<q[j].x&&q[i].y==q[j].y)
{
b=1;
}
else if(q[i].x==q[j].x&&q[i].y<q[j].y)
{
c=1;
}
else if(q[i].x==q[j].x&&q[i].y>q[j].y)
{
d=1;
}
if(a&&b&&d&&c)
{
ans++;
break;
}
}
}
}
printf("%d\n",ans);
}