int main()
{
int m, n;
while (cin >> n >> m)
{
UFSet uset(100000);
uset.makeSet(n);//初始化
//接收m对关系
int x = 0, y = 0;
for (int i = 0; i
cin >> x >> y;//注:这里数组下标代表人的对应编号
uset.unionSet(x, y);
}
cout << uset.getSets(n) << endl;
}
return 0;
}