lanoo

2008年4月10日

浙大ACM的fire net问题

摘要: 问题链接http://acm.zju.edu.cn/show_problem.php?pid=1002 Suppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a street o... 阅读全文

posted @ 2008-04-10 14:58 &lanoo; 阅读(1327) 评论(1) 推荐(0)
大数的加法计算

摘要: C语言实现大数的加法计算。 #include int main() { char a[1000]; //获取第一个数 int Count1 = 0; for(int i=0;(a[i]=getchar())!='\n';i++) Count1++; int Cou1 = (Count1%2==0)?Count1/2:(Count1/2+1);... 阅读全文

posted @ 2008-04-10 14:50 &lanoo; 阅读(379) 评论(0) 推荐(0)
约瑟夫问题

摘要: 设有N个人坐在圆桌周围,从第S个人开始报数,数到M的人出列,然后再从下一个人开始报数,数到 M的人又出列,如此重复,直到所有人都出列为止。按出列顺序输出每个人的信息。 代码: #include #include struct node { struct node * next; int value; }; void CreateList(struct node * he... 阅读全文

posted @ 2008-04-10 14:48 &lanoo; 阅读(191) 评论(0) 推荐(0)