#include <stdio.h>
int main( void )
{
int n;
while(scanf("%d",&n),n)
{
int i = 0, m=5, p,ans,l=0;
// scanf("%d", &n); //n总人数,m步长
while( ++i <= n )
{
p = i * m;
while (p > n)
p = p - n + (p - n - 1)/(m - 1);
l++;
if(p==1)
printf("%d\n", l);
ans=p;
}
}
// printf("%d\n",ans);
return 0;
}
/***************************************************
User name: TJRAC6015203228魏杰
Result: Accepted
Take time: 0ms
Take Memory: 112KB
Submit time: 2016-11-02 16:26:12
****************************************************/
sdut2056不敢死队问题
最新推荐文章于 2020-03-04 21:37:27 发布