题目内容

使用VC++6.0打开考生文件夹下的源程序文件1.cpp,使其输出结果为: n=0 注意:不要改动main函数,不能增加或删除行,也不能更改程序的结构,错误的语句在//******error******的下面。 试题程序: #include<iostream.h> //********error******** class TC() pLlblic: //********error******** void~TC() TC(int n) cout<<’n’<<’=’<<n<<end1; ; //********error******** void main() TC test(0); return;

查看答案
更多问题

Part A You will hear a passage about women’ s rights. Listen and complete the sentences in questions 1-5 with the information you have heard. Write not more than 3 words in each box. You will hear the recording twice. You now have 25 seconds to read the sentences in question. ______ discovered liquid fuel as a fuel for rockets.

Sigmund Freud was the first psychologist that made a careful study of ______ mind.

The Natural Approach believes that skills acquired through ______ transfer to other skills.

使用VC++6.0打开考生文件夹下的源程序文件3.cpp,阅读下列程序说明和代码,功能如下: 从屏幕输入数字,然后由大到小插入指定的链中。当输入0时,表示输出的数据已经输入完成,把数据打印到屏幕,并释放内存。 其中定义的类不完整,按要求完成下列操作,将类的定义补充完整。 (1)在父结点的Next中保存新插入的结点的指针,请在注释1后添加适当的语句。 (2)把pNext的子结点赋给pNext本身,请在注释2后添加适当的语句。 (3)判定p的子结点不为空,如果不为空,则打印p中的数据到屏幕,请在注释3后添加适当的语句。 (4)用t1保存动态申请内存结点的链表头,请在注释4后添加适当的语句。 注意:仅在函数指定位置添加语句,请勿改动主函数main与其他函数中的任何内容。 试题程序: #include<iostream.h> class TC public: TC(int data=0) this—>data=data; this—>next=NULL; int data; TC *next; ; void Insert(TC *p,int data) TC *temp=new TC(data); TC *pParent=p; TC *pNext=p—>next; while(pNext) if(data)pNext—>data) //********1******** temp—>next=pNext; return; else pParent=pNext; //********2******** if(pNext==NULL) pParent—>next=temp; return; void printf(TC *p) //********3******** while() cout<<p—>next—>data<<""; p=p—>next; cout<<end1; void Delete(TC *p) //********4******** TC *t1=; TC *t2; while(t1!=NULL) t2=t1—>next; delete t1; t1=t2; void main() int i=0; TC head; do int data; cout<<"请输入一个数字:"<<end1; cin>>data; if(data==0)break; Insert(&head,data); while(1); printf(&head); Delete(&head); return;

答案查题题库