c语言城市链表(C language city list)
c语言城市链表(C language city list)
# includes stdio.h > <
# includes stdlib.h > <
# includes string.h > <
# includes conio.h > <
# includes math.h > <
typedef struct q
{char [20].
int x;
int y;
struct q * prior;
struct q * next;
} node, * list.
list created ();
void find (list);
void (pos list);
void add (list);
void of (list);
void show (list);
void print ()
void main ()
(list l)
int t;
char c = y;
while ((c = = y is | | c = = y)
{system ("cls");
print ();
printf ("请输入:");
scanf ("% d" & t).
switch (t)
case 1: l = {created (); break;
case 2: find (l); break;
case 3: add (l); break;
case 4: ((l); break;
case 5: pos (l); break;
case 6: show (l); break;
}
printf ("输入y则继续操作, 输入其他则结束! \ n ");
c = getch ();
}
}
void print ()
{
printf ("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * the * * * * * * * * * * * * * * * \ n");
printf ("* * * * * * * * * * * * * * * * * * * * * * < 城市链表 > > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * the * * * * * * * * \ n");
printf ("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * the * * * * * * * * * * * * * * * \ n");
printf ("* * * * * * * * * 按1: 输入城市信息 按2: 查找城市信息 * * * * * * * * * * * * \ n");
printf ("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * the * * * * * * * * * * * * * * * \ n");
printf ("* * * * * * * * * 按3: 增加一个城市信息 按4: 删除一个城市信息 * * * * * * * * \ n");
printf ("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * the * * * * * * * * * * * * * * * \ n");
printf ("* * * * * * * * * 按5: 查找小于等于某距离的所有城市信息 按6: 显示所有城市信息 * * * * * * * * \ n");
printf ("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * the * * * * * * * * * * * * * * * \ n");
printf ("* * *