Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
32696 于俊杰 报数问题 C++ Accepted 4 MS 736 KB 294 2022-07-26 12:05:34

Tests(5/5):


Code:

#include<iostream> using namespace std; int main(){ int n,m,t=0,s=0; bool f[105]={0}; cin>>n>>m; for(int i=1;;i++){ if(i==n+1) i=1; if(!f[i]){ t++; if(t==m){ cout<<i<<' '; f[i]=1; s++; t=0; if(s==n) break; } } } return 0; }