readdir()在多线程操作中不安全,Linux提供了readdir_r()实现多线程读取目录内容操作。#include
#include #include int main(void){ DIR* dirp; struct dirent
*dp1=malloc(sizeof(stru...
分类:
其他好文 时间:
2014-05-12 13:34:35
阅读次数:
914
偷西瓜
时间限制:1000 ms | 内存限制:65535 KB
难度:4
描述
对于农村的孩子来说最大的乐趣,莫过于和小伙伴们一块下地偷西瓜了,虽然孩子们条件不是很好,但是往往他们很聪明,他们总在计算着到达瓜田的距离,以及逃跑的路线,他们总是以最短的距离冲到瓜田里面,然后以最短的距离回到出发的地方,不过瓜田的大人们已经在他们来的路上等待他们。于是聪明的小伙伴们...
分类:
其他好文 时间:
2014-05-12 07:13:05
阅读次数:
383
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=&problem=2459
明天省赛,所以今天做几道所谓水题,可惜这个题因为输出写错WA了很久,,,
如果直接枚举矩阵所有的位置是否改变,那么时间复杂度是承受不住的
这道题让我学到的,就是:
...
分类:
其他好文 时间:
2014-05-12 07:10:08
阅读次数:
374
#include#includetypedef struct node { int data;
struct node *lchild,*rchild;};node * create()//先序建立二叉树,根左右{ int x=0; node *t;
printf(" input data:"); ...
分类:
其他好文 时间:
2014-05-11 01:19:08
阅读次数:
311
基于mysql数据库整合框架时出现的数据库字符编码的问题.
解决办法:数据库驱动的版本太高,换成低版本的,主要还是你的架包太不是最新版本,出现的兼容性问题。
分类:
编程语言 时间:
2014-05-10 18:13:53
阅读次数:
473
在下例中,演示了链表的各种操作
#include
using namespace std;
typedef struct Node
{
int data; //数据域
struct Node * next; //指针域
}NODE, *PNODE; //NODE相当于struct Node, PNODE相当于struct Node *
PNODE CreateList()...
分类:
其他好文 时间:
2014-05-10 04:29:49
阅读次数:
263
将IP表存入SQL里的程序
写得比较粗糙,还有一点错误,不过能达到效果,请大家测试
create.asp
-----------------------------------------------------------------------
'Option Explicit
Server.Scripttimeout = 1000
On Error Resume N...
分类:
数据库 时间:
2014-05-10 04:22:32
阅读次数:
563
Redis的client设计如下:
/* With multiplexing we need to take per-clinet state.
* Clients are taken in a liked list. */
typedef struct redisClient {
int fd;
redisDb *db;
int dictid;
sds que...
分类:
其他好文 时间:
2014-05-10 03:44:21
阅读次数:
292
'EXCELa.VBS '直接将查询数据结果生成 EXCEL 表,稍做修改后即可
'改成ASP文件放在服务器上面向客户
option Explicit
dim conn,strConnString
Set conn = WScript.CreateObject("ADODB.Connection")
on error resume next
strConnString ="Provid...
分类:
其他好文 时间:
2014-05-10 03:43:27
阅读次数:
375
题目:意思就是判断给定的几条线段是否有相交的。
方法:模版吧,有空在来细细学习。
代码:
#include
#include
using namespace std;
struct Point
{
double x,y;
};
struct LineSeg
{
Point a,b;
};
double Cross(Point a, Point b, Poi...
分类:
其他好文 时间:
2014-05-10 03:39:07
阅读次数:
326