📄 zrndi.h
字号:
/* xkrndf.h freeware xhunga@tiscali.fr */
/* ------------------------------ FUNCTION -------------------------- rnd0_I() */
/*Call : time_t t; */
/* int i; */
/* */
/* srand(time(&t)); */
/* i = rnd0_I(9); */
/* -------------------------------------------------------------------------- */
int rnd0_I(
int maxI)
{
int x;
x = rand() % maxI;
if(x)
{
x *= -pow(-1,x);
}
return(x);
}
/* ------------------------------ FUNCTION -------------------------- rnd0_I() */
/*Call : time_t t; */
/* int i; */
/* */
/* srand(time(&t)); */
/* i = rnd0_I(9); */
/* -------------------------------------------------------------------------- */
int rndp0_I(
int maxI)
{
return(rand() % maxI);
}
/* ------------------------------ FUNCTION --------------------------- rnd_I() */
/*Call : time_t t; */
/* int i; */
/* */
/* srand(time(&t)); */
/* i = rnd_I(9); */
/* -------------------------------------------------------------------------- */
int rnd_I(
int maxI)
{
int x;
x = (rand() % maxI) + 1;
x *= -pow(-1,x);
return(x);
}
/* ------------------------------ FUNCTION --------------------------- rnd_I() */
/*Call : time_t t; */
/* int i; */
/* */
/* srand(time(&t)); */
/* i = rnd_I(9); */
/* -------------------------------------------------------------------------- */
int rndp_I(
int maxI)
{
return((rand() % maxI) + 1);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -