文章
55
粉丝
100
获赞
12
访问
30.9k
#include<stdio.h>
#include<iostream>
#include<vector>
using namespace std;
int main(){
int n,s,m;
while(cin>>n){
vector<int> vec(n);
for(int i = 0; i<n; i++){
vec[i] = i+1;
}
cin>>s>>m;
if(s==0 && m==0 && n==0){
break;
}
int idx = s-1;
while(vec.size()>0){
idx = (idx+m-1)%vec.size();
if(vec.size()>1){
cout<<vec[idx]<<",";
}else{
cout<<vec[idx]<<endl;
}
vec.erase(vec.begin()+idx);
}
}
}
登录后发布评论
暂无评论,来抢沙发