求这道题的c语言编程 感谢大佬 我的同学 自动避让
Recently, Kale finds that his mobile phone address book can’t add new friends’ phone numbers. He turns to ask for your help because he knows that you are learning high-level programming language. To help him, you need to design a new mobile phone address book in accordance with the following requirements.Dynamic memory structure should be used because of his large social circles. He often makes new friends, but also deletes phone numbers of those who hasn’t heard from for a long time. But, if they, whose phone number was deleted , re-contact Kale, he would like to add their phone numbers into the phone address book.
Notice:
Kale’s original phone book includes groups of names and phone numbers, a name is expressed as a string whose length will not be longer than 20; similarly, a phone number is expressed as a string, whose length will not exceed 20. Names and phone numbers don't have extra space characters.
To meet Kael’s requirements, you should include the operations as follows:
Insert A Num behind B : where A, B are names and Num is the phone number of A. if A is already in phone address book, then update the phone number; or add A behind B (if there was no B in list, then add A to the beginning of the list).
Delete A: Remove buddy A from the address book (if there was no A in list, you may do nothing).
In order to validate your program, it is necessary to design the operation as follow:
Print: Output the entire address book in sequence (Output all buddy's names and phone numbers one time, separated by one space)
Requirements: This experiment must be achieved with a linked list.
The format of the input data:
From the first line to the end: Each line is an operation, you should execute them in turns.
Terminator: “End” indicates the termination of the input.
The format of the output data:
Each operation needed to output exports with one line.
Sample
Input:
Insert LiLei 14068888 behind Nobody
Insert Joker 04517999 behind LiLei
Insert Healer 987213 behind Joker
Delete LiLei
End
Output:
LiLei 14068888
Joker 04517999
Healer 987213
Joker 04517999
Healer 987213