摘要:
约瑟夫环经典问题,题意不解释用循环链表过于费时,以下为代码:#include #include #include typedef struct node{ int data; struct node *next;}LinkList;int main(){ int i,j,k,t,m,n; while(scanf("%d%d",&n,&m)!=EOF&&n||m) { LinkList *head,*back,*front,*temp; head=back=front=NULL; for(i=1;idata=i; if(i==1) { head 阅读全文