给你N信封和1张卡片,让你从左到右选择信封(要求是右信封比左信封大)且最左边的信封要能装进卡片#include #include #include using namespace std;struct Node{ int si, sj; unsigned short n;};Node S...
分类:
其他好文 时间:
2014-08-25 20:50:04
阅读次数:
186
Linux2.4下驱动中定时器的应用我的内核是2.4.18的。Linux的内核中定义了一个定时器的结构:#includestruct timer_list{ struct list_head list;unsigned long expires; //定时器到期时间unsigned long dat...
分类:
系统相关 时间:
2014-08-25 16:51:24
阅读次数:
322
7.1、7.2、7.3#include#include#include#includeusing namespace std;struct Sales_data{ string bookNo;//isbn编号 unsigned units_sold=0;//该书的销量 double...
分类:
编程语言 时间:
2014-08-25 14:45:24
阅读次数:
297
一、内核定时器定义:struct timer_list { struct list_head entry; unsigned long expires; void (*function)(unsigned long); unsigned long data; struc...
分类:
系统相关 时间:
2014-08-24 11:30:02
阅读次数:
241
最近在做64位代码移植,代码中到处充斥着类型转换,到处报编译警告和错误,比如以下使用:
unsigned int ret=0,*p=NULL;
p = (unsigned int *)malloc(sizeof(4));
ret = (unsigned int )p;
以上这段代码,在32位编译系统中没问题,但是在64位编译系统中就会报错,说是类型转换size不一样,因为在64位,所有指针...
分类:
其他好文 时间:
2014-08-23 23:01:01
阅读次数:
264
一、sizeof sizeof(...)是运算符,在头文件中typedef为unsigned int,其值在编译时即计算好了,参数可以是数组、指针、类型、对象、函数等。它的功能是:获得保证能容纳实现所建立的最大对象的字节大小。由于在编译时计算,因此sizeof不能用来返回动态分配的内存空间的大小。实...
分类:
其他好文 时间:
2014-08-23 16:42:31
阅读次数:
252
cocos2d-x 中,字体文件需要保存在 fonts 文件夹中,如果字体路径中没有 fonts/ 会自动添加上这个文件夹。如果字体名称没有 .ttf 后缀,也会自动加上这个后缀。unsigned char* CCFreeTypeFont::loadFont(const char *pFontNam...
分类:
其他好文 时间:
2014-08-23 11:07:10
阅读次数:
193
题目来源:URAL 1748. The Most Complex Number
题意:求一个小于等于n的因子最多的数
思路:搜索+剪枝
#include
#include
using namespace std;
typedef unsigned __int64 LL;
LL prime[16] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53...
分类:
其他好文 时间:
2014-08-22 21:12:09
阅读次数:
228
struct sockaddr {unsigned short sa_family; /* address family, AF_xxx */char sa_data[14]; /* 14 bytes of protocol address */};sa...
分类:
其他好文 时间:
2014-08-21 16:28:24
阅读次数:
221
//测试CPU核心个数#if !defined (_WIN32) && !defined (_WIN64)#define LINUX#include #else#define WINDOWS#include #endifunsigned core_count(){ unsigned count =....
分类:
其他好文 时间:
2014-08-21 13:08:44
阅读次数:
157