Input

Output

Examples
Input

5
1
1
3
2
5
4
3
3
4
-1
3
2
6
-1

Output

-1
5 1 1 5 4 4

Note

## 只需在最后输出链表元素，空格分隔

#include
#include
#include
typedef struct node
{
int data;
struct node *qian,*hou;
} NODE;
{
NODE *p;
p=p->hou;
else{
p->qian->hou=p->hou;
p->hou->qian=p->qian;
free(p);
return 0;}
}
int main()
{
int x;
scanf("%d",&x);
if(x!=-1)
{
q=(NODE *)malloc(sizeof(NODE));
q->data=x;
p=q;
}
else
{
}
getchar();
scanf("%d",&x);
while(x!=-1)
{
q=(NODE *)malloc(sizeof(NODE));
q->data=x;
p->hou=q;
q->qian=p;
p=q;
scanf("%d",&x);
}
//chuxian -1

``````//----------------------finished creating

int y,k;
scanf("%d",&y);
while(y!=-1)
{
if(k==-1)
printf("-1\n");
scanf("%d",&y);
}
NODE *pr;
do
{
printf("%d ",pr->data);
pr=pr->hou;
``````

}

2个回答

``````#include "stdio.h"
#include "stdlib.h"
#include "string.h"

typedef struct node
{
int data;
struct node *qian,*hou;
} NODE;
{
NODE *p;
p=p->hou;
else{
p->qian->hou=p->hou;
p->hou->qian=p->qian;
free(p);
return 0;}
}
int main()
{
int x;
while (true)
{
scanf("%d",&x);
if (x == -1) break;
p =(NODE *)malloc(sizeof(NODE));
p->data = x;
}

//----------------------finished creating

int y,k;
scanf("%d",&y);
while(y!=-1)
{
if(k==-1)
printf("-1\n");
scanf("%d",&y);
}
NODE *pr;
do
{
printf("%d ",pr->data);
pr=pr->hou;
}

``````

``````在主函数里调用delete_cycle      时出错了，把x改成y
``````
`````` k = delete_cycle(head, y);
``````
``````还有就是delete_cycle  函数也有问题，你只删除了一个元素，题目要求删除所有相同的元素
``````

function insertHtml(HtmlCode)rnrn var win =window.doc_html.HtmlEdit.document;rn rn window.doc_html.HtmlEdit.focus();rn //win.selection.createRange().pasteHTML(HtmlCode);rn win.body.innerHTML=HtmlCode;rnrnrn我用这个函数时，用IE6。0浏览访问就很正常，在低版本的IE里就提示body不是对象，无法正常的调用此函数

rnCREATE procedure Sp_Combination_Insertrn(@MoreSelectTotal int,rn@SigleTotal int,rn@DisputeTotal int,rn@Title VarChar(100),rn@Createtime DateTime,rn@SigleSelectSubjectScore int,rn@MoreSelectSubjectScore int,rn@DisputeSubjectScore int)rnasrnrndeclare @Sigle varchar(8000)rndeclare @More varchar(8000)rndeclare @Dispute varchar(8000)rndeclare @strsql1 varchar(1000)rndeclare @strsql2 varchar(1000)rndeclare @strsql3 varchar(1000)rnrnrnrnrnset @strsql1='select @Sigle=isnull(@Sigle,'''') + rtrim(SigleSelectId) +'','' from (rnselect top '+ @SigleTotal +' SigleSelectId from SigleSelectSubjectrnorder by newid())a'rnexec (@strsql1)rnrnrnset @strsql2='select @More=isnull(@More,'''') + rtrim(MoreSelectId) +'','' from (rnselect top '+@MoreSelectTotal +' MoreSelectId from dbo.MoreSelectSubjectrnorder by newid())b'rnexec (@strsql2)rnrnrnset @strsql3='select @Dispute=isnull(@Dispute,'''') + rtrim(DisputeId) +'','' from (rnselect top' +@DisputeTotal+ ' DisputeId from dbo.DisputeSubjectrnorder by newid())c'rnexec (@strsql3)rnrnrnrninsert Combination ( Title,rn rn SigleSelectSubject ,rn MoreSelectSubject, rn DisputeSubject ,rn Createtime ,rn SigleSelectSubjectScore ,rn MoreSelectSubjectScore, rn DisputeSubjectScore rn )rnrnvalues (@Title,rn rn @Sigle ,rn @More, rn @Dispute ,rn @Createtime ,rn @SigleSelectSubjectScore ,rn @MoreSelectSubjectScore, rn @DisputeSubjectScore rn )rnrnGOrn
[表单提交]不知道哪里出了问题

[code=html]rnrnrn Contact Formrn rn rnrnrn rn rn First Name:rn rn rn rn Last Name:rn rn rn rn E-mail:rn rn rn rn Phone:rn rn rn rn Comments:rn rn rn rn rn rn rnrnrn[/code]rn出来成了这样rn[img=https://img-bbs.csdn.net/upload/201611/04/1478252464_531048.png][/img]rn这段代码是截出来的，不知道问题在哪，求指导。
android的问题不知道哪里出了问题

leetcode（简单）：环形链表

c++快速排序 不知道哪里出了问题
includeusing namespace std;void fun(int a[],int low,int high) int i,j,key,change; i=low; j=high; key=a[low]; while(ikey) j--; if(i>n; for(int h=0;h>a[h]; fun(a,0,n-1); for(int g=0;g

c++快速排序 不知道是哪里出了问题 ....
#includernusing namespace std;rnvoid fun(int a[],int low,int high)rnrn int i,j,key,change;rn i=low;rn j=high;rn key=a[(low+high)/2];rnrn while(ikey)rn --j;rn if(i>=j)rn break;rn if(i>n;rn for(int h=0;h>a[h];rnrn fun(a,0,n-1);rn for(int g=0;g

[code=c]#include rn#include rn#include rnusing namespace std;rnclass HelloWord rnpublic:rn static string getInfo(string str)rn rn string str1, str2, str3;rn bool bl = false;rn cin >> str1;rn cin >> str2;rn cin >> str3;rn int s1 = str1.size(), s2 = str2.size(), s3 = str3.size();rn int i = 0, x = 0, y = 0;rn if (s1 + s2 == s3 && (s1!=0 || s2!=0))rn rn for (; i != s3; i++)rn rn if (str3[i] == str1[x])rn rn x++;rn bl = true;rn rn else if (str3[i] == str2[y])rn rn y++;rn bl = true;rn rn elsern rn bl = false;rn str = "NO";rn break;rn rn rn if (bl)rn rn str = "YES";rn rn rn elsern rn str = "NO";rn rn return str;rn rn;rnint main()rnrn string c = HelloWord::getInfo("Hello World");rn cout << c << endl;rn[/code]

select distinct a.REPORT_TIME,a.FRA05,b.area_name,from rnTB_JP_JA2001_DATA a,t_area b where a.FRA05 = b.area_code and (FRA05 like ('43%') and A12='1' or DWBS='10' rngroup by a.REPORT_TIME,a.FRA05,b.area_namernrn这条语句前两天还可以用，今天突然不能用了rnrn发现 不用or或者不用group by就可以用，rn再或者只从一个表里取数据也可以用，rn但和在一起就不能用了rnrn不知道哪里出了问题，请教~~rn

#includern#includernvoid main()rnrn char *str1[20],*str2[20],*str3[20];rn char swap();rn printf("Input three lines:\n");rn gets(str1);rn gets(str2);rn gets(str3);rn if(strcmp(str1,str2)>0)swap(str1,str2);rn if(strcmp(str1,str3)>0)swap(str1,str3);rn if(strcmp(str2,str3)>0)swap(str2,str3);rn printf("Now,the order is:\n");rn printf("%s\n%s\n%s\n",str1,str2,str3);rnrnrnchar swap(char *p1,char *p2)rnrn char *p[20];rn strcpy(p,p1);strcpy(p1,p2);strcpy(p2,p);rn

long long lcm_naive(int a, int b) rn long long lcm = a * b;rn return lcm;rnrnrnint main() rn int a, b;rn std::cin >> a >> b;rn std::cout << lcm_naive(a, b) << std::endl;rn return 0;rnrnrninput:rn28851538 1183019rnoutput应该是34131917633222rn没超出long long的范围，但返回值是-187468090rn将long long换成unsigned long long返回值是unsigned long long的最大值18446744073709551615 这个数....rnrnrn不知道哪里出问题了，求指点。。。。

dim article_title,article_content,article_class,article_author,IncludePic,article_image,article_keyrnarticle_class=trim(request("article_class"))rnarticle_title=trim(request("title"))rnarticle_content=Server.HTMLEncode(request("content"))rnIncludePic=trim(request("IncludePic"))rnarticle_author=trim(request("author"))rnarticle_image=trim(request("DefaultPicUrl"))rnarticle_key=trim(request("key"))rnrnset rs=server.createobject("adodb.recordset")rnsql="select * from article"rnrs.open sql,conn,1,3rnrs.addnewrnrs("article_class")=article_classrnrs("article_title")=article_titlernrs("article_content")=article_contentrnif IncludePic="yes"thenrnrs("article_pic_or")=1 rnif article_image<>"" thenrnrs("article_image")=article_imagernend ifrnelse rs("article_pic_or")=0rnend ifrnrs("article_author")=article_authorrnrs.updaternrs.closernset rs=nothingrnResponse.Write" "rnrn表单中的内容我看都没有错，主体内容我用的编辑器，应该没有错误，就是提示‘update’有错！rn

qduoj 一道简单的数据结构题（水题）

#includern#define uint unsigned intrn#define uchar unsigned charrn rnuint i=0;rnuint PWM=0; rnvoid Timer1_Init(); // T1 rnvoid Timer0_Init(); //rnvoid main()rnrn //P1=0xFF;rn rn TMOD=0X11; // rn EA=1;rn Timer1_Init();rn Timer0_Init();rn while(1); rn rnrnrnrnvoid Timer1_Int() interrupt 3rnrn TH1=0XD8;rn TL1=0XEF;rn P1=0xFF;rn TH0=(65535-PWM)/256 ;rn TL0=(65535-PWM)%256 ;rn TR0=1;rnrn rnrnvoid Timer0_Int() interrupt 1rnrn rn P1=0X00;rn TR0=0;rn PWM=PWM+20;rn if(PWM==10000)rn PWM=0;rnrnvoid Timer1_Init()rnrn TH1=0XD8;rn TL1=0XEF;rn ET1=1;rn TR1=1;rnrnrnvoid Timer0_Init()rnrn TH0=(65535-PWM)/256;rn TL0=(65535-PWM)%256 ;rn ET0=1;rnrn