Run ID:155724
提交时间:2026-06-13 10:43:22
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,m,s=0,w=0,b=0; cin>>n>>m; bool a[101]={0}; while(s!=n-1){ w++; if(w>n)w=1; if(!a[w])b++; if(b==m){ b=0; cout<<w<<" "; a[w]=1; s++; } } return 0; }