//洛谷P1996 #include<bits.stdc++.h> struct node{ int data; node *next; }; int main(){ int n,m;sacnf("%d %d",&n,&m); node *head,*p,*now,*prev; head = new node ;head->data=1;head->next=NULL; now = head; for(int i=2;i<=n;i++){ p=new node;p->data=...