avatar
wjtlqybd

nuduwhopotej 654 1st Jul, 2022

int Max(CBlist l)
{
	NodeCB* p;
	int Max;
	Max = l.head->x.succhua;
	while (p != NULL)
	{
		if (Max < p->x.succhua)
		{
			Max = p->x.succhua;
		}
		p = p->next;
	}
	return Max;
}
void xuatRaNhungCBcoSucChualonNhat(CBlist l) {
	int succhuaMax = Max(l);							//Tại vì ông thầy nói tìm DAnh sách nên có thể có nhiều CB cùng sức chứa nên tìm max trc
									//rồi so sánh cái nào =  max thì cout ra.

	NodeCB* cur = l.head;
	while (cur != NULL) {
		if (cur->x.succhua == succhuaMax) {					//Cais nayf m thich cout ra gif thi tuy
			cout << cur->x.MS << endl;
		}

		cur = cur->next;
	}
}
Markup
Description

No description

To share this paste please copy this url and send to your friends
RAW Paste Data