如何用PHP编写 ——刷新按钮,急求,谢谢!
答案:2 悬赏:40
解决时间 2021-03-15 23:03
- 提问者网友:你在我眼中是最帅
- 2021-03-15 11:29
最好有详细代码,
最佳答案
- 二级知识专家网友:堕落奶泡
- 2021-03-15 13:08
我晕。。js会吗
刷新
刷新
全部回答
- 1楼网友:一场云烟
- 2021-03-15 13:51
//createlist_l.cpp
//to create a linklist
#include
#include
#include
# define true 1
# define false 0
# define ok 1
# define error 0
# define infeasible -1
# define overflow -2
typedef struct dulnode
{ int data;
struct dulnode *prior;
struct dulnode *next;
}dulnode,*dulinklist;
// 初始条件:l已存在。操作结果:返回l中数据元素个数
int listlength(dulinklist l)
{
int i=0;
dulinklist p=l->next; // p指向第一个结点
while(p!=l) // p没到表头
{
i++;
p=p->next;
}
return i;
}
// 由双链循环线性表l的头结点出发,正序输出每个数据元素
void listtraverse(dulinklist l)
{
dulinklist p=l->next;
while(p!=l)
{
cout<data<<"\t";
p=p->next;
}
cout<prior;
while(p!=l)
{
cout<data<<"\t";
p=p->prior;
}
cout<next=l->prior=l;
cout<<"createlist_l"< ";
cin>>n;
cout<<"please input the data for dulinklist nodes: "<0;--i)
{
p=(dulinklist)malloc(sizeof(dulnode));
cin>>p->data; //reverse order inputing for creating a linklist
p->prior=l;
p->next=l->next;
l->next->prior=p;
l->next=p;
}
if(n)
{
cout<>i;
while (i<1||i>listlength(l)+1)
{
//i值不合法
cout<<"illeagle location,please input the correct location:";
cin>>i;
}
cout<<"input the number you want to insert:";
cin>>e;
while(jnext;
++j;
}
if(!(s=(dulinklist)malloc(sizeof(dulnode))))
{
cout<data=e;
s->prior=p->prior;
s->next=p;
if(i==1)
l->next=s;
p->prior->next=s;
p->prior=s;
cout<<"has insert:"<>i;
while(i<0||i>listlength(l))
{
//i值不合法
cout<<"illeagle location,please input the correct location:";
cin>>i;
}
p=l->next; // p指向第一个结点
while(p!=l&&jnext;
j++;
}
if(p==l||j>i) // 第i个元素不存在
{
cout<<"第i个元素不存在"<data; // 取第i个元素
if(!p) // p=null,即第i个元素不存在
return error;
e=p->data;
p->prior->next=p->next;
p->next->prior=p->prior;
free(p);
cout<<"has delete:"<>c;
}
if(c!=0)
{
menu(c);
cin>>c;
}
}
}
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯