4 条题解
-
0
#include<bits/stdc++.h> using namespace std; struct Node{ int data; Node *next; }; int a[100005]; int main(){ int n; cin>>n; Node *head=nullptr; for(int i=1;i<=n;i++){ Node *now=new Node; int da; cin>>da; now->data=da; now->next=head; head=now; } Node *move=head; int num=n; while(move!=nullptr){ a[num]=move->data; move=move->next; num--; } for(int i=1;i<=n;i++){ cout<<a[i]; } Node *mov=head; for(int i=1;i<=n;i++){ delete mov; mov=mov->next; } }
信息
- ID
- 13834
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 10
- 标签
- (无)
- 递交数
- 5
- 已通过
- 0
- 上传者