Void main ()
{
Int n, I, k=0;
While (~ the scanf (" % d ", & amp; N)) {
If (n==0) break;
for(i=1; i<=n; I++) {
K=(k + 3) % I;
}
Printf (" % d \ n ", k + 1);
}
}
Ask what is the principle of this kind of writing, don't understand the logic
CodePudding user response:
I also don't understand, but I suspect that should be a kind of mathematical calculation methodCodePudding user response:
This is the classic Joseph ringCodePudding user response:
https://blog.csdn.net/qq_21201267/article/details/104442971Joseph ring problem, please refer to my blog
https://blog.csdn.net/qq_21201267/article/details/88563448