摘要: #include <stdio.h>typedef struct node_t{ struct node_t *next; char *word; int count;}*node;#define NHASH 9973 // 最好定位质数#define MULT 31 // 乘法器node bin[NHASH]; // 哈希表索引unsigned int hash(char *p){ unsigned int h = 0; for(; *p; p++) h = MULT * h + *p; return h % NHASH;}vo... 阅读全文
posted @ 2012-09-13 17:47 庄庄庄 阅读(3444) 评论(0) 推荐(0) 编辑
摘要: while(<DATA>){ $str .=$_;}print &delHtml($str);<>;sub delhtml{ my($str) = @_; my($s_pos) = 0; my($e_pos) = 0;loop: if(index($str,'<') != -1) { $s_pos = index($str,'<'); $e_pos = index($str,'>',$s_pos); if($s_pos > 0) ... 阅读全文
posted @ 2012-09-13 16:51 庄庄庄 阅读(354) 评论(0) 推荐(0) 编辑