#include <stdio.h> #include <time.h> int main (void) { struct tm *gm_date; tim…
克努特 – 莫里斯 – 普拉特算法的C语言实现 /* Copyright 2011 Shao-Chuan Wang <shaochuan.wang A…
# include struct node { int l,r; }; struct node tree[100]; int path[100]; int ans; void in…
/** *@brief 对于url中的一些特殊字符会被转义以利传输, * 并且, 归档服务器上, php写入cookie中的值可能存在特殊字符, 需要转换 * *参考: http:…
// KMP字符串模式匹配算法 // 输入: S是主串,T是模式串,pos是S中的起始位置 // 输出: 如果匹配成功返回起始位置,否则返回-1 int KMP(PString S…
#include <stdio.h> inline void xchg(int *a,int *b) { (*a)^=(*b);//^=(*a)^=(*b); (*b)…
#include<stdio.h> #include<stdlib.h> #include<string.h> struct book{ int…
#include <stdint.h> #include <stdlib.h> #include <string.h> #define BLOC…
霍夫曼编码(Huffman Coding)是一种编码方式,是一种用于无损数据压缩的熵编码(权编码)算法。1952年,David A. Huffman在麻省理工攻读博士时所发明的,并…
#include <string> using namespace std; string Encode(char* Data,long DataByte) { //编…
#ifndef _DBUFF_VEW_H #define _DBUFF_VEW_H #include <atlbase.h> #include <atlstr.h…
/* 魔方阵,古代又称“纵横图”,是指组成元素为自然数1、2…n的平方的n×n的方阵, 其中每个元素值都不相等,且每行、每列以及主、副对角线上各n个元素之和都相等。 输…