题目来源:HDU 1542 Atlantis
题意:给你一些矩形(左下角和右上角)求面积
思路:参考here这个超赞的 一看就懂了
#include 
#include 
#include 
#include 
using namespace std;
const int maxn = 210;
struct node
{
	double l, r, h;
	int s, val;
	nod...
                            
                            
                                分类:
其他好文   时间:
2014-05-07 08:59:09   
                                阅读次数:
395
                             
                    
                        
                            
                            
                                常见系统数据文件
下表列出了常见的系统数据文件及其查找函数。
以/etc/passwd文件为例,读取数据的程序框架如下:
void get_pw_entry()
{
    struct passwd *ptr; 
    setpwent();
    while ((ptr = getpwent()) != 0) {
        ……
    }
    endpwe...
                            
                            
                                分类:
其他好文   时间:
2014-05-07 08:46:54   
                                阅读次数:
341
                             
                    
                        
                            
                            
                                简单的说,i2c驱动也就三步吧,注册i2c设备,注册i2c设备驱动,创建sysfs文件供上层调用。
1. 注册i2c设备。
先定义一个i2c_board_info
static struct i2c_board_info __initdata xxxx_i2c_info[] = {    
     
        {    
        I2C_BOARD_INFO("XXX...
                            
                            
                                分类:
其他好文   时间:
2014-05-07 08:34:39   
                                阅读次数:
333
                             
                    
                        
                            
                            
                                题意:所有n个人围成一个圈,
#include
#include
struct Node
{
 int data;
 Node *next;
 Node *prior;      
};
Node* CreateList(Node* &head, int n);
Node* searchk(Node *ptr, Node* &head, int k);
Node* rsearchm(Node...
                            
                            
                                分类:
其他好文   时间:
2014-05-07 06:26:28   
                                阅读次数:
327
                             
                    
                        
                            
                            
                                关于结构体的一个问题:
看下面这个结构体的声明,把它记作A
struct node
{
	int a;
	float b;
	struct node *next;
}s;
和如下的结构体声明,把它记作Bstruct node
{
	int a;
	float b;
	struct node  next;
}s;
他们的区别是啥?
今天学习《C和指针》第10...
                            
                            
                                分类:
编程语言   时间:
2014-05-07 03:19:10   
                                阅读次数:
313
                             
                    
                        
                            
                            
                                Populating Next Right Pointers in Each Node 
IGiven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode 
*right; TreeLin...
                            
                            
                                分类:
其他好文   时间:
2014-05-07 01:34:51   
                                阅读次数:
407
                             
                    
                        
                            
                            
                                递归版
struct Edge
{
	int from, to, cap, flow;
	Edge(){}
	Edge(int from, int to, int cap, int flow) : from(from), to(to), cap(cap), flow(flow){}
};
int n, m, s, t;
vector  edges;
vector  G[maxn];
bool v...
                            
                            
                                分类:
其他好文   时间:
2014-05-06 23:39:25   
                                阅读次数:
351
                             
                    
                        
                            
                            
                                n个数,只能用
F[i][j]=(F[i-1][j]+F[i-1][j-1])*j
F[i][j]代表i个数,有j个不同值的情况。比如A
大数模板
#include 
#include 
const int MAX =505;
struct BigNum
{
    int num[MAX];
    int len;
} a[51][51];
BigNum  Add(...
                            
                            
                                分类:
其他好文   时间:
2014-05-06 23:06:51   
                                阅读次数:
364
                             
                    
                        
                            
                            
                                tm结构体的定义在time.h里面
struct tm {
    int tm_sec;
    int tm_min;
    int tm_hour;
    int tm_mday;
    int tm_mon;
    int tm_year;
    int tm_wday;
    int tm_yday;
    int tm_isdst;
};
/*...
                            
                            
                                分类:
系统相关   时间:
2014-05-06 22:26:46   
                                阅读次数:
474
                             
                    
                        
                            
                            
                                手动搭建struct2的时候,总是会碰到找不到Filter的问题,到底是怎么回事呢?
其实,关键就在于导入的五个jar包,我们最好是将它放在web-inf目录下,然后再组织导入,这样web.xml才能顺利找到。
至于struct.xml,目前放在src目录下就好。
自己的技术水平一向让自己无语,碰到这样个问题都得搞半天……...
                            
                            
                                分类:
其他好文   时间:
2014-05-06 15:31:26   
                                阅读次数:
225