weixin_56939440 2022-03-14 22:32 采纳率: 0%
浏览 161

Process exited after 1.026 seconds with return value 3221225477

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
typedef struct link
{
char dada[10];
struct link *next;

}link;

link *Qele(char b[],link *L,int a)
{
link *temp,*r,z;
int i=0;
r=L;
for(i=0;i<a;i++)
{
r=r->next;
}
temp=(link
)malloc(sizeof(link));
strcpy(temp->dada,b);
r->next=temp;
r=r->next;
r->next=NULL;
return L;
}

link *qele(char b[],link *l,int a)
{
link *temp,*r,z;
int i;
for(i=0;i<a;i++)
{
r=r->next;
}
r=l;
temp=(link
)malloc(sizeof(link));
strcpy(temp->dada,b);
r->next=temp;
r=r->next;
r->next=NULL;
return l;
}

int main()
{
char a[10],b[10],c[10],ar[10]="IN",as[10]="V";
int n,i,r,s,nu=0,nb=0;
link *L,*l;
L->next=NULL;
l->next=NULL;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%s",a);
r=strcmp(ar,a);
if(r==0)
{
scanf("%s%s",b,c);
s=strcmp(as,c);
if(s==0)
{
L=Qele(b,L,nu);
nu++;
}
else
{
l=qele(b,l,nb);
nb++;
}
}
else
{
scanf("%d",c);
s=strcmp(as,c);
link *z;
if(s==0)
{
z=L->next;
L=z->next;
free(z);
nu--;
}
else
{
z=l->next;
l=z->next;
free(z);
nb--;
}
}
}
link *rs;
rs=L;
while(rs->next!=NULL)
{
printf("%s",rs->dada);
rs=rs->next;
}
rs=l;
while(rs->next!=NULL)
{
printf("%s",rs->dada);
rs=rs->next;
}

return 0;

}

  • 写回答

1条回答 默认 最新

报告相同问题?

问题事件

  • 创建了问题 3月14日

悬赏问题

  • ¥15 FFmpeg 成功推流到 Nginx RTMP 服务器但无法用 ffplay 或 VLC 播放
  • ¥15 请修改以下C语言代码使其能正确输出最短路径
  • ¥20 抖音商城拉码器安卓报错求解决办法或者有新的拉码脚本也可以介绍一下
  • ¥15 MPLAB IDE V2.35 报错make[2]: *** [build/default/production/_ext/1472/MSSP_I2C.p1] Error 1
  • ¥15 Unity2D URP项目TextMeshPro(3D)无法显示文字
  • ¥15 新唐M451 DTMF检测和发送代码修改
  • ¥15 在国外文献网站里点击view pdf 加载异常缓慢甚至加载不出来。
  • ¥65 python批量提取发票的信息
  • ¥15 虚幻五引擎内容如何上传至网盘?
  • ¥15 使用mmpose库时出现了问题