void delete(List* head, int a, int b) {
List *p, *q;
q = head;
p = head->next;
while (p != head) {
if(p->data > a && p->data < b) {
q->next = p->next;
free(p);
p = q->next;
}
else {
p = p->next;
q = q->next;
}
}
}
void erase(Lnode *head, int x, int y)
{
Lnode *p = head -> next;
if(!p) return ;
Lnode *q = head;
while(p != head)
{
if(p -> data > x && p -> data < y)
{
if(p -> next == head)
q -> next = head;
else
q -> next = p -> next;
free(p);
p = q -> next;
}
else p = p -> next;
}
}
void delete(List* head, int a, int b) {
List *p, *q;
q = head;
p = head->next;
while (p != head) {
if(p->data > a && p->data < b) {
q->next = p->next;
free(p);
p = q->next;
}
else {
p = p->next;
q = q->next;
}
}
}
void delete(List* head, int a, int b) {
List* p, * q;
q = head;
p = head->next;
while (p != head) {
if (p->data > a && p->data < b) {
q->next = p->next;
free(p);
p = q->next;
}
else {
p = p->next;
q = q->next;
}
}
}
void delete(List* head, int a, int b) {
List *p, *q;
q = head;
p = head->next;
while (p != head) {
if(p->data > a && p->data < b) {
q->next = p->next;
free(p);
p = q->next;
}
else {
p = p->next;
q = q->next;
}
}
}
void delete(List* head, int a, int b) {
List *p, *q;
q = head;
p = head->next;
while (p != head) {
if(p->data > a && p->data < b) {
q->next = p->next;
free(p);
p = q->next;
}
else {
p = p->next;
q = q->next;
}
}
}
登录后提交答案