依稀记得学C语言的时候写过这样的代码来实现约瑟夫环(貌似期末的实验考试就是抽到了这个题,我才不会告诉你我拿了100分捏)
#include <stdio.h>
void main()
{
int n;
printf("Input the number of person:");
scanf("%d",&n);
int num[50],*p=num;
for(int i=0;i<n;i++)
*(p+i)=i+1;//给每个人编号
int k=0,m=0;