📄 1210 eddy's 洗牌问题.c
字号:
/*
1210 Eddy's 洗牌问题
Time Limit : 1000 ms Memory Limit : 32768 K Output Limit : 256 K
15 MS 184 KB 428 B
GUN C++
*/
#include <stdio.h>
int main()
{
int N;
int iCount;
int first;
int i;
while(scanf("%d", &N) != EOF){
iCount = 1;
first = 2;
while(first != 1){
if(first > N){
first = (first - N) * 2 - 1;
}
else{
first *= 2;
}
iCount++;
}
printf("%d\n", iCount);
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -