王思源

 

04 2011 档案

emacs 使用 etags 阅读代码
摘要:1 生成TAGS使用etags前要先生成TAGS文件。在很多网上的资料中[1][2]都是使用这样一条命令find . -name "*.[chCH]" -print | etags -管道前是一个查找文件的命令,但是我搞不懂etags 后的 - 是什么意思。请知道的同学告诉我,谢谢了。受到参考文献[3]的启发,想出了两个更容易理解的命令,我要阅读的代码中只有 .c .h .S 三种文件命令一:find . -name "*.[chS]" | xargs etags命令二:etags `find . -name "*.[chS]"` 阅读全文

posted @ 2011-04-28 15:36 王思源 阅读(1792) 评论(1) 推荐(0)

Section 1.4,Mother's Milk
摘要:1题目描述http://ace.delos.com/usacoprob2?a=bDgbfJDh5Pw&S=milk32解题思路广度优先搜索,具体如下:1)搜索状态保存在一个队列中结构体queue中,已经存在的状态保存在一个二维数组statelist中2)在一个二重循环中产生下一个状态3)加入队列的条件是下一状态在statelist中不存在。3代码/*ID: wangsiy1LANG: CTASK: milk3*/#include <stdio.h>#include <stdlib.h>#include <string.h>#define QL 阅读全文

posted @ 2011-04-27 19:18 王思源 阅读(228) 评论(0) 推荐(0)

Section 1.4,The Clocks
摘要:1题目描述英文:http://ace.delos.com/usacoprob2?a=2dcMjFnNl7S&S=clocks中文翻译:http://www.nocow.cn/index.php/Translate:USACO/clocks2深度优先搜索解法2.1 思路:用二进制的三位保存一个时钟的状态。低两位表示四种状态,第三位用作进位,每次操作后置零[1][2]2.2 代码:/*ID: wangsiy1LANG: CTASK: clocks*/#include <stdio.h>#include <stdlib.h>#include <string.h& 阅读全文

posted @ 2011-04-26 19:28 王思源 阅读(325) 评论(0) 推荐(0)

导航