保安值班安排系统

[复制链接]
查看11 | 回复0 | 2007-12-27 20:46:27 | 显示全部楼层 |阅读模式
你可以明确的指出来是哪些地方需要注释,,要是每一句都注释很麻烦的...#include #include static char *WEEK[7] = {"Sun.", "Mon.", "Tues.", "Wedn.", "Thur.", "Fri.", "Sat."}; //定义一个字符型指针数组并赋值int IsChecked(const int pSon[]){
int i, j;
for (i=0; i>(3*j)) & 7L; //给数组person[]赋值
}
if (!(person[0]==2 || person[0]==4))continue;//如果person[0]==2或person[0]==4为假,进入到下面的for循环
else if (!(person[1]==1 || person[1]==6))continue; //解释如上类似
else if (!(person[2]==3 || person[2]==0))continue; //...
else if (!(person[3]==5))continue;
//...
else if (!(person[4]==1 || person[4]==4 || person[4]==6))continue;//...
else if (!(person[5]==2 || person[5]==5))continue;//...
else if (!(person[6]==3 || person[6]==6 || person[6]==0))continue;//...
else if (!IsChecked(person)) continue; //如果IsChecked(person)返回值为0,进入下面的for循环
for (j=0; j<7; ++j){
printf("%s ", WEEK[person[j]]); //输出可执行方案.%s是设置输出方式
}
printf("\n");
++t; //i每次以某一值执行一次t自增,以记录可行方案的次数
}
printf("\n%d Methods!\n", t); //输出可实行的方案数目
getch();}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行