#include<bits/stdc++.h> using namespace std; struct node { int date; node *next; node() { date=0; next=NULL; } }; node head; void build_list() { cout<<"ÇëÊäÈëÁ´±í³¤¶È"<<endl; int n; cin>>n; node *p=&head; for(int i=1;i<=n;i++) { if(p->next==NULL) { p->next=new node; } p=p->next; cin>>p->date; // p->next=NULL: } } int main() { build_list(); node *p=&head; while(p->next!=NULL) { cout<<"==="; p=p->next; cout<<p->date<<endl; } change(p); }
浙公网安备 33010602011771号