#define MSG_HEAD_LEN 4//消息头部结构typedef struct tagMsg
{ //消息类型 u16 type; //消息体长度 u16 length;}TMsg;void receive(SOCKET s){ char
buffer[1024*28]; //CServM...
分类:
其他好文 时间:
2014-06-06 11:25:33
阅读次数:
243
Sort a linked list using insertion sort./** *
Definition for singly-linked list. * struct ListNode { * int val; * ListNode
*next; * ListNo...
分类:
其他好文 时间:
2014-06-06 10:39:38
阅读次数:
212
测试 代码运行时间linux 中的 中 有个函数可以获取当前时间,精确到 微秒
----> gettimeofday() 1 #include // int gettimeofday(struct timeval *tv,
struct timezone *tz); 2 /***...
分类:
系统相关 时间:
2014-06-06 09:10:48
阅读次数:
248
```cppenum Iter: Int{ case s1=0, s2, s3, s4
mutating func next(){ if self == .s4 { self = .s1 return } ...
分类:
其他好文 时间:
2014-06-06 09:07:38
阅读次数:
215
枚举 使用enum创建枚举——注意 Swift 的枚举可以关联方法: 1 enum Rank:
Int { 2 case Ace = 1 case Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten 3
case Jack, Q...
分类:
其他好文 时间:
2014-06-06 08:30:54
阅读次数:
285
#include#includetypedef struct Node{ int
data; struct Node *next;}LinkList;//就地反转int LinkListRerverse(LinkList
*head){ LinkList *q,*p; p = head->next;...
分类:
其他好文 时间:
2014-06-06 07:35:54
阅读次数:
283
示例代码注重这里p1的作用以下代码是用尾插法添加结点#include #include #define
N sizeof (STU)typedef struct stu{ int num; char name[20];} STU, * PSTU;PSTU
creat (PSTU head) ...
分类:
其他好文 时间:
2014-06-05 19:49:50
阅读次数:
351
三元组表的C++语言描述基本运算的算法——建立稀疏矩阵的三元组表的算法、按矩阵的列序转置算法、按矩阵的行序转置算法#includeusing namespace
std;template class sanyuanzu{ private: struct Node {...
分类:
其他好文 时间:
2014-06-05 18:29:41
阅读次数:
318
十字链表的语言描述基本运算的算法——建立稀疏矩阵的十字链表的算法、输出稀疏矩阵十字链表的算法#includeusing namespace
std;template class shizi{private: struct Node { int i; int j...
分类:
其他好文 时间:
2014-06-05 18:25:08
阅读次数:
272
题意:给定N中货币 两种货币之间可以兑换 并且收取一定的费用 问 给定你一种货币与数量
是否能兑换到原来的货币 使自己的货币增加思路:用bellman算法 判断是否有回路不断的增大;#include#includeusing namespace
std;struct Node{ int u,v; d...
分类:
其他好文 时间:
2014-06-05 18:18:16
阅读次数:
178