2012年3月24日

约瑟夫环,杀人游戏(静态循环链表实现)

摘要: 觉得用静态循环链表最划算了。1、动态链表要动态分配,指针移来移去,释放指针等等,弄得很烦,容易出错。2、用循环链表是当然的了。// DS: 似循环静态链表 #include <iostream> #include <cstdio> //#include <cstdlib> using namespace std; int Kill_You( const int sum = 1, const int distance = 1, const int start = 1) { // 一共参加自杀的人数有 sum 个,每 distence 个人就杀一个,从第 sta 阅读全文

posted @ 2012-03-24 15:51 jjtx 阅读(269) 评论(0) 推荐(0) 编辑

导航