FHDFGH
2026-10-25 16:56:20
发布于:浙江
#include<bits/stdc++.h>
using namespace std;
struct node{
int data;
node *next;
};
int main(){
int n,x;
cin>>n;
node *head,*r,*p;
head=new node;
head->next=NULL;
r=head;
for(int i=1;i<=n;i++){
cin>>x>>p=new node;
p=new node;
p->date=x;
p->next=NULL;
r->next=p;
r=p;
}
p=head;
while(p->next!=NULL){
cout<<p->next->data<<" ";
p=p->next;
}
return 0;
}
全部评论 1
你的代码很润~归我了!
1周前 来自 浙江
0
























有帮助,赞一个