# include
using namespace std;
Struct box
{
Char maker [40].
Float height;
Float width;
The float length;
Float volume;
Box * next;
};
Box * head;
Box * the create ()
{
Float heights;
Box * p=NULL;
Box * q=NULL;
The head=NULL;
cout <"Both please enter box height" & lt; Cin & gt;> Heights;
While (heights!=0)
{
P=new box;
P - & gt; Height=heights;
cout <"Both please enter box width & lt;" Cin & gt;> P - & gt; Width;
cout <"Both please enter box length" & lt; Cin & gt;> P - & gt; length;
cout <"Both please enter box maker" & lt; Cin. Getline (p - & gt; Maker, 40);
If (head==NULL)
{
The head=p;
}
The else
{
Q - & gt; Next=p;
}
Q=p;
cout cout <"Both please enter box height" & lt; Cin & gt;> Heights;
}
cout If (a head!=NULL)
{
Q - & gt; Next=NULL;
}
Return the head;
}
Void the display (box * head)
{
cout <"Box height, width, length, volume and maker." & lt; While (the head!=NULL)
{
cout <"Height=" & lt; <"Width=" & lt; <"Length=" & lt; <"Volume=" & lt; <(the head - & gt; Height) * (head - & gt; Width) * (head - & gt; Length) & lt; <"Maker is" & lt; The head=head - & gt; next;
}
}
Int main ()
{
The display (the create ());
system("pause");
return 0;
}
My zha don't let me enter this step jump over CodePudding user response:
Because the above input have enter, so will be over CodePudding user response:
fflush(stdin);
Cin. Getline (p - & gt; Maker, 40);
So it is good CodePudding user response: