文档介绍:摘要 1
前言 2
正文 3
问题描述 3
采用类c语言定义相关的数据类型 3
各模块的伪码算法 4
函数的调用关系图 8
调试分析和测试结果 8
软件使用说明书 11
设计总结 13
参考文献 15
致谢 16
附nutLnikList(LiiikList *L, mt peisoiiNumbeij
Node *p, *q;
mt i,a;
P = (*L);
p->data = 1;
prmtf(,'\na=n);
scaiif("%d'\&a);
switch(a)
(case 1:p->passwoid = GetPasswoi d 1 ();break;
case 2:p->passwoid = GetPasswoid2Q;break;
)
fbi (i = 2; i <= personNumber; i++)
{
q = (LinkList)malloc(sizeof(Node));
迁(q = NULL)
{
pnntff'memoiy allocation failed, goodbye”);
exit(l);
}
switch(a)(
case 1:p->password = GetPasswoid 1 Q;bieak;
case 2:p->password = GetPasswoid2();bieak;
)
q->data = i;
p->next = q;
p = q;
)
p->next = (*L);
)
输入密码:
mt GetPasswoid 1()
{
mt password 1;
static nit count 1 = 1;
pnntff'please enter the password of %d:H,countl);
scaiif(H%d,\&passwoidl);
if (password 1 > MAXPASSWORD || password 1 < 0)
(
piintff'your number is not usefiil,please pmitf the int fiom 0 to %d:”,MAXPASSWORD);
scanf(n%dH,&passwoidl);
}
count 1++;
retuni password 1;
}
mt GetPasswoid2()
(mt password2;
static mt count2 = 1;
password2=count2+2;
punt町The %d people's password is %d\ii,\count2,password2);
count2-H-;
return passwoid2;
}
输出结果:
void prmtResult(int arraypeisoiiNumbei)
(
mt i;
print町\nthe order of outmg the queue:”);
fbr(i = 0; i < peisonNumber; i++)
{
printf(”%-3d”,an-ay[i]);
)
prmtf(u\nu);
)
4函数的调用关系
1、清输入围坐在圆桌周围的人数n: 7
请输入开始上限数m: 20
请依次输入每个人的密码:3 4 5 6 7 8 9
出列的顺序如下:6 2 1 7 5 4 3
C:\DOCUIE~l\ADmiiI~l\桌面\
please enter the personnunber:7
the final personnumber is 7
please enter the initial getfirstcountualue:20
the final firstcountualue is 20
a=l please please please please please please please
enter enter enter enter enter enter enter
the the the the the
the the
password of password of password of password of password of password of password of
•4 • O
JL * O O .
匕. Ju o • c J ■。
A ■ u jt ■ o
匚■ ^7
U ■ O 0*