简单链表输入输出:
#include#include using namespace std;int a[100]; struct poi{ int now; poi *next;};int main(){ poi *start; poi *now; now=NULL; start=now; int i=0; poi *noww; while (++i<=10) { noww=new poi; noww->next=now; start=noww; now=noww; scanf("%d",&now->now); } printf("%d\n",start->now); now=start; while (now!=NULL) { printf("%d\n",now->now); now=now->next; }}