精品・原创・海量・电子文档交易市场
VIP

N个人围成一圈-从第一个开始报数-第k个退出-再从1开始报数-依次循环-直到最后一个人(共3页).docx

0.9 我要评价: 举报
作者/来源: 好好学习 | 发表时间: 2026年11月03日 | 作品编号: 235877892575685 | 3页 | 10.26KB | Word文件
【摘要】 #include<stdio.h> #include<stdlib.h> #include<malloc.h> struct ring { int number; struct ring *next; }; struct ring* creat(int n ) { struct ring *q,*p,*head; int i=1; q=head=NULL; while(i<=n) { p=(struct ring*)malloc(sizeof(struct ring)); p->number=i; if(q==NULL) { head=q=p; } else { q->next=p; q=p; } i++; } q->next=head; return head; } struct ring* delete_number(struct ring *head,int k) { struct
会员专享推荐 · 你可能也用得上更多
开通 会员,畅读全站文档
  • 海量文档免费下载
  • 付费文档8折优惠下载
  • 畅享AI无限创作
  • 尊贵VIP标识
  • 高速下载通道不排队
  • VIP专属客服
  • 全平台无广告
  • 预览文本无限复制
/ 3