救救猫咪(结构体+枚举)

//这道题本人用的结构来写的,然后枚举(其他的我真想不出来了)

救救猫咪(结构体+枚举)

//这里我把结构体知识复习一遍:
结构体定义格式
1.struct 结构体名{  
};
2. struct 结构体名{
}变量名;
3. struct  结构体名{
}结构体指针;
4. struct  结构体名{
}结构体数组;
5.typedef struct {
} 结构体名;
6.typedef struct 结构体名1 {
} 结构体名;//这里是结构体名1的替换
结构体对象访问格式 对象名.成员
结构体指针访问方式  1.指针名->成员;2.(*结构体指针名).成员;
结构体与模板
结构体模板声明:
template<class T,class T2.......>
struct 结构体名{
};```
实例化(我的理解为向内存里面装东西(如果内存有内容那就是换))
结构体名<类型> 对象名;
//题解:
#include<iostream>
using namespace std;
typedef long long ll;
struct zuobiao {
	ll x;
	ll y;
	ll record = 0;//记录有多少成立
}zuo[1001];
int main()
{
	int n,i=0,t;
	cin >> n;
	t = n;
	while (n--)
	{
		cin >> zuo[i].x >> zuo[i].y;
		i++;
	}
	//枚举每个点
	for (int j = 0; j < t; j++)
	{
		for (int u = 0; u < t; u++)
		{
			if (zuo[j].x < zuo[u].x&&zuo[j].y < zuo[u].y)
			{
				zuo[j].record++;
			}
		}
	}
	for (int y = 0; y < t; y++)
	{
		cout << zuo[y].record << '\n';
	}
	return 0;
}