📄 customtype.h
字号:
//////////////////////////////////////////////////////////////////////////
//the scale of the problem
//#define N 10;
const int N = 10;
//////////////////////////////////////////////////////////////////////////
//define door state
enum tagDoorState
{
DS_OPEN,
DS_CLOSE
}DoorState;
//////////////////////////////////////////////////////////////////////////
//implement the function
void ChangeDoorState(int door[], int n)
{
// first time open all doors [9/30/2008 wkc]
for (int l = 1; l <= n; l++)
{
door[l - 1] = DS_OPEN;
}
for (int i = 2; i <= n; i++)
{
for (int j = i; j <= n; j *= i)
{
door[j - 1] = (door[j - 1] == DS_CLOSE) ? DS_OPEN : DS_CLOSE;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -