#include
#define M 8
Void Josephus ()
{
INT I, J, S, A [M], N;
Printf ("please input n =");
Scanf ("% d", & n);
For (i = 0; i
A [i] = 1;
J = 0;
For (i = 0; i
{
S = 0;
While (s
{
IF (j
J = J 1;
Else
J = 0;
S = S a [J];
}
IF (j! = 0)
Printf ("% 3D / N", J);
Else
Printf ("% 3D / N", M);
a [j] = 0;
}
}
void main ()
{
Josephus ();
}