听灌多
  • 板块灌水区
  • 楼主lyclyclyc1234
  • 当前回复0
  • 已保存回复0
  • 发布时间2024/7/22 10:52
  • 上次更新2024/7/22 11:44:29
查看原帖
听灌多
461855
lyclyclyc1234楼主2024/7/22 10:52
#include<bits/stdc++.h>
using namespace std;
int main(){
//	freopen("circlecount.in","r",stdin);
//	freopen("circlecount.out","w",stdout);
	int a,bb,c[101],d=0,e,f;
	cin>>a>>bb;
	for(int i=1;i<=a;i++){
		c[i]=i;
	}
	for(int i=0;i<a;i+=0){
		cout<<bb<<" ";
		d+=bb;d%=a;
		if(d==0){
			d=a;
		}cout<<c[d]<<" ";
		a--;
		e=a;
		for(int j=d;j++;j<=e){
			c[j-1]=c[j];
		}
//		for(int j=1;j<=a;j++){
//			cout<<c[j]<<" ";
//		}cout<<endl;
	}
	return 0;
}

输入 4 17

输出

17 1

3 2

2 3

1 4

bb的值为什么会变?

2024/7/22 10:52
加载中...