#include<iostream>
using namespace std;
struct List
{
double num;
List* next;
};
int main()
{
List* head, * p;
head = new List;
p = head;
int n = 3;
while (n--)
{
p->num = n;
p->next = new List;
p = p->next;
}
n = 3;
p = head;
while (n--)
{
cout << p->num << endl;
p = p->next;
}
cout << "FOUND OVER!" << endl;
n = 3;
p = head;
while (n--)
{
if (1 == p->num)
cout << "I FIND IT." << endl;
p = p->next;
}
n = 1;
p = head;
List *t;t=new List;
while (n--)
{
p = p->next;
}
t->next=p;
head->next=t;
t->num=4;
List* a = new List;
a->next = head;
head = a;
a->num = 10;
List* b = new List;
p = head;
n = 4;
while (n--)
p = p->next;
p->next = b;
p = b;
b->num = 20;
n = 6;
p = head;
while (n--)
{
cout << p->num << endl;
p = p->next;
}
cout << "INSECT OVER!" << endl;
p = head;
p = p->next;
p->next = t->next;
delete t;
n = 5;
p = head;
while (n--)
{
cout << p->num << endl;
p = p->next;
}
cout << "DELETE OVER!" << endl;
}