请使用“答题”菜单或使用VC6打开考生文件夹proj2下的工程proj2,函数void Insert(node*q)使程序能够完成如下功能:从键盘输入一行字符,调用该函数建立反序的无头结点的单链表,然后输出整个链表。
注意:请勿修改主函数main和其他函数中的任何内容,只需在画线处编写适当代码,也不能删除或移动//************found************。
//源程序proj2.cpp
#include<iostream>
using namespace std;
struct node
char data;
node*link:
*head; //链表首指针
void Insert(node*q) //将节点插入链表首部
//************found************
______;
head=q;
int main()
char ch;
node *p;
head=NULL:
cout<<"Please input the string"<<endl;
while((ch=cin.get())!=’\n’)
//************found************
______;//用new为节点p动态分配存储空间
p->data=ch;
//************found************
______; //在链表首部插入该节点
p=head;
while(p!=NULL)
cout<<p->data;
p=p->link;
cout<<endl;
return 0: