#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:…
#include <iostream> using namespace std; typedef enum Color { RED, BLACK, }Color; te…
#include<stdio.h> #define MAX 100 int insert(int a[],int n,int i,int x) { int j; if(…
#include <cstdio> /* * 传统的二分查找,数组有序且没有重复 */ int binary_S(int *a, int n, int key) { i…
C语言获取本机Mac地址的代码 //linux int GetLocalMacAddr(char *szMac,int *pnMacLen) { int sock; struct …
给定4个1-9之间的数,通过加减乘除四则运算算出24来,可以使用括号 #include "stdafx.h" #include <stdio.h> …
#include <iostream> #include <cstdlib> #include <ctime> using namespace …
// 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)…