码迷,mamicode.com
首页 >  
搜索关键字:unsigned    ( 4409个结果)
产生连续的随机数
之前用到的随机数是以时间为种子的,当连续产生的时候,就会出现问题,更改了下。在设置种子的时候加上一个随机数。试了试,感觉还OK。static unsigned int s_seed ; void Utils::random_seed(int seed) { if(!seed) s_seed=time(NULL); else s_seed=seed; } int Utils::random_...
分类:其他好文   时间:2015-04-01 13:22:00    阅读次数:143
URLEncode与URLDecode总结与实现
URLEncode: 用于编码URL字符串,数字和字母保持不变,空格变为'+',其他(如:中文字符)先转换为十六进制表示,然后在每个字节前面加一个标识符%,例如:“啊”字 Ascii的十六进制是0xB0A1——>%B0%A1代码实现: 1 unsigned char CHAR_TO_HEX( un....
分类:Web程序   时间:2015-04-01 13:15:34    阅读次数:132
hihocoder1014(字典树)
题目连接:点击打开链接 解题思路: 字典树模板题。论一套靠谱模板的重要性!!! 完整代码: #include #include #include #include #include #include #include #include using namespace std; typedef unsigned long long LL; const int ...
分类:其他好文   时间:2015-03-31 22:21:37    阅读次数:120
第一次作业
#include#include#includemain(){ int choice; int a,b,c; srand((unsigned) time(NULL)); printf("\n\n-------------每天一练-------------"); printf("\n1.加法运算...
分类:其他好文   时间:2015-03-31 19:40:33    阅读次数:112
iOS 获取当前的时间的后天
- (void)time{     NSDate *now=[NSDate date];     NSCalendar *cal=[NSCalendar currentCalendar];     unsigned int time=NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay|NSCalendarUnitHour|NSCa...
分类:移动开发   时间:2015-03-31 18:12:56    阅读次数:150
hihocoder1032(最长回文子串manacher算法)
题目连接:点击打开链接 解题思路: manacher算法的模板题。 完整代码: #include #include #include #include #include #include #include #include using namespace std; typedef unsigned long long LL; const int MOD = ...
分类:编程语言   时间:2015-03-31 18:09:37    阅读次数:176
HDU3068(最长回文子串manacher算法)
题目连接:点击打开链接 解题思路: manacher算法模板题。 完整代码: #include #include #include #include #include #include #include #include using namespace std; typedef unsigned long long LL; const int MOD = i...
分类:编程语言   时间:2015-03-31 18:05:25    阅读次数:179
hiho一下 第三十九周(逆序数)
题目连接:点击打开链接 解题思路: 逆序数模板题。注意此题坑点在于数据大,开成unsigned long long 完整代码: #include #include #include #include #include #include #include #include using namespace std; typedef unsigned long l...
分类:其他好文   时间:2015-03-31 18:03:28    阅读次数:177
作业1修改版(可计算)
#include #include #include main( ){ int i; int a,b,c,d,e; int count=0; srand( (unsigned)time( NULL ) ); for(i=1;i<31;i++) { a=rand()%10+1; ...
分类:其他好文   时间:2015-03-31 17:47:07    阅读次数:104
JZ2440点亮一个LED
点亮标号为D10的LED,其对应的GPIO为GPF4,即设置GPF4为输出口,并拉低为低电平【具体原理查看JZ2440原理图】 1 #define GPFCON (*(volatile unsigned long *)0X56000050) 2 #define GPFDAT (*(volatile ...
分类:其他好文   时间:2015-03-31 17:32:22    阅读次数:177
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!