s3c_led.c分析:http://blog.csdn.net/hurry_liu/article/details/87702061,注册设备号int register_chrdev_region(dev_t from, unsigned count, const char *name)动态分配设...
分类:
其他好文 时间:
2014-09-10 21:03:21
阅读次数:
298
1 #include 2 #include 3 #include 4 #include 5 #include 6 7 class S_DES { 8 private: 9 typedef unsigned int uint; 10 typedef un...
分类:
其他好文 时间:
2014-09-10 20:51:51
阅读次数:
215
k&r习题2-6,setbits(x,p,n,y),将x中从第p位开始的n个二进制位设置为y中最右边n位的值,x的其余各位保持不变。 #include<stdio.h>
unsigned setbits(unsigned x, int p, int n,unsigned y)
{
int mask;
...
分类:
编程语言 时间:
2014-09-10 17:59:11
阅读次数:
541
ZOJ 3814 Sawtooth Puzzle
题目链接
记录状态广搜,把9个拼图都压缩成一个状态,然后去搜索,就是模拟的过程比较麻烦
代码:
#include
#include
#include
#include
#include
using namespace std;
typedef unsigned long long ll;
int t;
int...
分类:
其他好文 时间:
2014-09-10 17:47:50
阅读次数:
220
1 #include "reg52.h" 2 #include "intrins.h" 3 #define uchar unsigned char 4 #define uint unsigned int 5 6 void delay( uchar x) 7 { 8 uint y; 9...
分类:
其他好文 时间:
2014-09-10 00:12:49
阅读次数:
230
说明:因为在牡丹江网络赛中看见北大AC非常简洁的代码里面把二进制用得是炉火纯青,在里面看见了处理二进制的函数,所以咱也学一下。
(1)
— Built-in Function: int __builtin_ffs (unsigned int x)
Returns one plus the index of the least significant 1-bit of x, or ...
分类:
其他好文 时间:
2014-09-09 23:07:39
阅读次数:
566
一个困扰很久的问题终于解决了,感谢万能的网络~在看项目代码的时候,看到很多宏定义“类型-1”,很纳闷,类型还能做减法??typedef unsigned int uint;#define a (uint)-1让我敲敲自己秀逗的脑袋,居然一直以为是减法。(uint)-1其实是强制类型转换,把-1转换成...
分类:
其他好文 时间:
2014-09-09 19:57:49
阅读次数:
122
题目链接:zoj 3816 Generalized Palindromic Number
题目大意:给定n,找一个最大的数x,保证x小于n,并且x为palindromic number
解题思路:枚举前i个放于n相同的数,然后去构造后半部分即可。
#include
#include
#include
using namespace std;
typedef unsigned...
分类:
其他好文 时间:
2014-09-09 13:20:28
阅读次数:
131
本节主要讲解的是:
while语句
if语句
for语句
逻辑运算符.
本节设计的新类型有:
bool 布尔值
unsigned 非负整数
short 至少16位整数
long
size_t 无符号整数类型,可以保存任何对象的长度
string::size_type 无符号整数类型,可以存储任意字符串的长度
书中的源代码:frame.cpp
#include ...
分类:
编程语言 时间:
2014-09-09 13:15:58
阅读次数:
371
注意转化为unsigned char:strcmp.h 1 #ifndef STRCMP_H 2 #define STRCMP_H 3 4 /*************************************************** 5 功能:比较字符串s1和s2。 6 一般形式:s.....
分类:
编程语言 时间:
2014-09-09 10:25:38
阅读次数:
401