delete pics to save space

This commit is contained in:
2023-08-03 09:22:52 +08:00
commit de60cd6ed4
1334 changed files with 66221 additions and 0 deletions

View File

@ -0,0 +1,44 @@
#include<cstdio>
using namespace std;
struct Node
{
int num;
Node *next=NULL;
};
int main()
{
Node head,*last,*p,*f;
last=new Node;
head.next=last;
int n,x,k;
scanf("%d",&n);
for(int i=0;i<n;i++)
{
scanf("%d",&x);
last->num=x;
last->next=new Node;
last=last->next;
}
scanf("%d",&k);
f=&head;
p=head.next;
while(p!=last)
{
if(p->num==k)
{
f->next=p->next;
delete p;
p=f;
}
f=p;
p=p->next;
}
p=head.next;
while(p!=last)
{
printf("%d ",p->num);
p=p->next;
}
return 0;
}