-
一个关于inet_ntoa的奇怪问题
摘要:无意中发现一个inet_ntoa函数的奇怪问题。 Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->#include #include #pragma comment( lib, "ws2_32.lib" ) struct socka...
阅读全文
-
Random Shuffles
摘要:http://www.maths.abdn.ac.uk/~igc/tch/mx4002/notes/node83.html random shuffle的原理 http://blog.csdn.net/zhaostu/archive/2007/01/19/1487912.aspx 后面一段关于播放列表random shuffle的还写的不错
阅读全文
-
strlen源码剖析(转)
摘要:http://www.cppblog.com/ant/archive/2007/10/12/32886.aspx
阅读全文
-
KMP算法
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> 下面是自己写的一个KMP算法实现。P为待查找串,Q为模式串,B为预处理数组。 #include #include #include #define MATCH_DETA...
阅读全文
-
字符串中单词逆序
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->/**//**//**//* * 将字符串中单词出现次序逆序。 * "123 45 6" --->> "6 45 123" * * 对字符串扫描两次,第一...
阅读全文
-
蚂蚁和木杆问题
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->最巧妙的方法是把两只蚂蚁相遇之后看出互相“穿透”。下面是老老实实的计算方法,呵呵。 /**//* * 题目:有一根27厘米的细木杆,在第3厘米、7厘米、11厘米、17厘米、23厘米这...
阅读全文
-
计算二进制中1的个数(转)
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->/**//* 解法一 将二进制数的各位相加,结果即为1的个数。从两位二进制开始计算。 55555555 h = 01010101010101010101010101...
阅读全文
-
双向链表插入删除
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->#include #include typedef struct node_t { int data; struct node_t* ...
阅读全文
|