解题思路:
注意事项:
参考代码
#include "stdio.h"
int main()
{
int n, m;
while (scanf("%d%d", &n, &m)!=EOF)
{
int num[100] = {0};
int count = 0,k=0;
for (int j = 0; j < n; j++)
{
if (num[j] == 0) { count++; }
if (count == m) { num[j] = 1; count = 0; k++; }
if (j == n - 1) { j = -1; }
if (k == n - 1) { break; }
}
for (int i = 0; i < n; i++)
{
if (num[i] == 0)printf("%d\n", i + 1);
}
}
}
:
0.0分
0 人评分