问题 填空题


假设某个不设头指针的无头结点单向循环链表的长度大于1,S为指向链表中某个结点的指针。算法f30的功能是,删除并返回链表中指针S所指结点的前驱。请在空缺处填入合适的内容,使其成为完整的算法。
typedef struct node{
DataType data;
struct node *next;
}*LinkList;
DataType f 30(LinkList s){
LinkList pre,p;
DataType e;
pre=s;
p=s—>next;
while( (1) ){
pre=p;
(2)
}
pre—>next= (3) ;
e=p—>data;
free(p);
return e;
}

答案

参考答案:s(或p—>next)

阅读理解
  Everyone needs friends. There is an old saying ,‘Friends are God’s way of taking care of us.” But how do you find real friend and keep it?
A Chinese writer Bai  Xun tells young students some smart ways to find friends. She says finding friendship is just like planting a tree. You plant the seed and take care of it to make it grow.  
First, you should choose a friend. What makes a good friend? It is not because a person has money or good looks .A good friend should be kind and patient .For example , if you have a bad day, a good friend should listen to your complaints and do his or her best to help you. To make a friend, you can not be too shy. You should make each other happy and share your lives.
But things cannot always be happy. Even the best friends have fights. What should they do when you have a fight with your friend ? You have to talk to him or her .When there is no one around , have an honest talk. If he or she doesn’t want to talk, you could write a letter.
There are three steps to being friends again: Tell him or her how you are feeling, say what your friend has done wrongly, and explain why you did this or that . Remember that friendship is the most important thing in your life.
小题1:Bai Xue wants to tell students the ways to ______ .
A.find friendsB.plant treesC.get happyD.keep fit
小题2:What makes a good friend ?A good friend should ________ .
A.be lovely and coolB.be kind and patient
C.have lots of moneyD.have good looks
小题3: According to the text, you can ______ your friend after a fight.
A.buy a present forB.never say a word to
C.have a dinner withD.write a letter to
小题4:. Which of the following is NOT told in the text?
A.Tell your friend how you are feeling. B.Say what your friend has done wrongly.
C.You will make new friends soon in a new place.
D.Explain why you did this or that.
小题5:.What is the best title for the text?
A.Teenagers and friendship.B.The good friends around you.
C.The trouble of growing up.D.The care and keeping of friendship.
选择题