#include <stdio.h>
#include <malloc.h>
Keyboard input Chain List
struct wyq{
Char name[100];
int age;
Char address[100];
struct Wyq*next;
};
int main ()
{
struct wyq*
Head
struct wyq*p;
struct wyq*q;
int i;
head= (struct wyq*) malloc (sizeof (struct wyq));
if (null==head) {
printf ("No successful Application");
Exit (-1);
}
printf ("Input list node content: \ n");
printf ("Name--");
scanf ("%s", head->name);
printf ("Age");
scanf ("%s", head->age);
printf ("Address,");
scanf ("%s", head->address);
head->next=null;
P=head;
Q=head;
printf ("1; continue; 2 stop \ n");
scanf ("%d", &i);
while (i==1) {
p= (struct wyq*) malloc (sizeof (struct wyq));
printf ("Input list node content: \ n");
printf ("Name--");
scanf ("%s", p->name);
printf ("Age");
scanf ("%s", p->age);
printf ("Address,");
scanf ("%s", p->address);
p->next=null;
q->next=p;
Q=p;
printf ("1; continue; 2 stop \ n");
scanf ("%d", &i);
if (i==2) {
Break
}
}
return 0;
}
Keyboard input Chain List 1