Run ID:104741
提交时间:2025-01-09 19:27:17
#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; bool a[101]={0}; cin>>n>>m; int s=0,t=0,c=0; while(s<n-1){ c+=1; if(c>n) c=1; if(!a[c]) t++; if(t==m){ t=0; cout<<c<<" "; a[c]=1; s++; } } return 0; }