#include
using namespace std;
Struct Dancer
{
int num; No.//dancers
String name;//name
int age;//age
String sex;//gender
Int height;//height
Int weight;//weight
The string type.//dance type
};
Struct Node
{
Dancer data;
Struct Node * next;
};
The class DancerList
{
Public:
DancerList ()
{
First Node *=new Node;
First - & gt; Next=NULL;
}
~ DancerList ()
{
The Node * p, * q;
P=first;
While (p)
{
Q=p;
P=p - & gt; Next;
The delete q;
}
}
Void the Insert ()//add
{
Node * z;
Z=new Node;
Cout & lt; <"Num:";
Cin & gt;> Z - & gt; Data. The num;
Cout & lt; <"Name:";
Cin & gt;> Z - & gt; Data. The name;
Cout & lt; <"Sex";
Cin & gt;> Z - & gt; Data. The sex;
Cout & lt; <"The age:";
Cin & gt;> Z - & gt; Data. The age;
Cout & lt; <"Height:";
Cin & gt;> Z - & gt; Data. The height;
Cout & lt; <"Weight:";
Cin & gt;> Z - & gt; Data. The weight;
Cout & lt; <"Type:";
Cin & gt;> Z - & gt; Data. The type;
Z - & gt; Next=first - & gt; Next;
First - & gt; Next=z;
}
Void the Delete (int num)
{
The Node * p, * q;
Q=first;
P=q - & gt; Next;
While (p)
{
If (p - & gt; Data. The num==num)
break;
Q=p;
P=p - & gt; Next;
}
If (p==NULL)
Cout & lt; <"Error" num & lt;
{
Q - & gt; Next=p - & gt; Next;
The delete p;
}
}
Void the Modify (int num)
{
The Node * p, * q;
Q=first;
P=q - & gt; Next;
While (p)
{
If (p - & gt; Data. The num==num)
break;
Q=p;
P=p - & gt; Next;
}
If (p==NULL)
Cout & lt; <"Error" num & lt;
{
Cout & lt; <"Change.";
Cout & lt; <"Num:";
Cin & gt;> P - & gt; Data. The num;
Cout & lt; <"Name:";
Cin & gt;> P - & gt; Data. The name;
Cout & lt; <"Sex";
Cin & gt;> P - & gt; Data. The sex;
Cout & lt; <"The age:";
Cin & gt;> P - & gt; Data. The age;
Cout & lt; <"Height:";
Cin & gt;> P - & gt; Data. The height;
Cout & lt; <"Weight:";
Cin & gt;> P - & gt; Data. The weight;
Cout & lt; <"Type:";
Cin & gt;> P - & gt; Data. The type;
Cout & lt; <"Success" & lt;
}
Node * Search (int num)
{
Node * p;
P=first - & gt; Next;
While (p)
{
If (p - & gt; Data. The num==num)
break;
P=p - & gt; Next;
}
return p;
}
Int the Count ()
{
int count=0;
Node * p;
P=first - & gt; Next;
While (p)
{
count++;
P=p - & gt; Next;
}
Cout & lt; <"Number has been input dancers: :" & lt;
}
Void the output ()
{
Cout & lt; <"Number" & lt; <'\ t' & lt; <"Name" & lt; <'\ t' & lt; <"Gender" & lt; <'\ t' & lt; <"Age" & lt; <'\ t' & lt; <"Height" & lt; <'\ t' & lt; <"Weight" & lt; <'\ t' & lt; <"Dance" & lt;
P=first - & gt; Next;
While (p)
{
Cout & lt; Cout & lt; P=p - & gt; Next;
}
}
Private:
Node * first;
};
# include "dancer1. H"
#include
#include
using namespace std;
Int main ()
{
DancerList d;
Int choice=1;
Int n=0;
Int k=0;
Int t=0;
Node * p;
While (choice!=8)
{
Cout<& lt;" * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * "& lt;
cin> Choice;
The switch (choice)
{
Case 1:
D.I nsert ();
break;
Case 2:
Cout<& lt;" Please input dancers to delete information number: "& lt;
D.D elete (n);
break;
Case 3:
Cout<& lt;" Please input dancers to modify information number: "& lt;
D.M odify (k);
break;
Case 4:
Cout