输入字符串到文本文件,然后读取文件中的字符串,奖励双向链表,删除最长和最短的字符串,输出删除后的双向链表,假如有相同长度的字符串,输出长度。急求啊!#include
#include
using namespace std;
struct node{
string data;
node *next;
node *pre;
};
node *createBidirList(int n)
{
node *temp,*tail = NULL,*head = NULL;
string str;
head = new node;
if(head ==NULL)
{
cout <
return NULL;
}
else
{
head->data = str;
head->next =NULL;
head->pre = NULL;
tail = head;
}
for(int i=0;i
{
temp = new node;
if(temp==NULL)
{
cout <
return head;
}
else
{
temp->data =