本题没有加入正确日期判断功能 #include struct date { int year; int month; int day; }; int leap_year(int a); int cal_day(struct date a); /*判断闰年*/ int leap_year(int a) { if(a%400==0||(a%4==0&... Read More
posted @ 2008-07-08 16:02 齐心 Views(22726) Comments(2) Diggs(0) Edit
分析:先创建一个有total个结点的链表,然后头尾相连,构成一个环形链表。从第一个结点开始数到第m个结点,从链表中删除对应结点,表示小孩出圈。然后再从被删除结点的下一个结点重新开始计数,直到链表中剩下最后一个结点。 #include #include #define LEN sizeof(struct child) struct child { int num; struc... Read More
posted @ 2008-07-08 15:15 齐心 Views(719) Comments(0) Diggs(0) Edit
#include #include typedef struct node { int data; struct node *next; }NODE; NODE *head=NULL; /*函数声明*/ NODE *createlist_head(int len); NODE *createlist_end(int len); NODE *createlist_so... Read More
posted @ 2008-07-08 14:44 齐心 Views(656) Comments(0) Diggs(0) Edit