摘要:
#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... 阅读全文
摘要:
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) ... 阅读全文