码迷,mamicode.com
首页 >  
搜索关键字:unsigned    ( 4409个结果)
实现位操作
//实现对一个8bit数据(unsigned char类型)的指定位的置0或者置1操作,并保持其他位不变 #include void bit_set(unsigned char *p_data,unsigned char position,int flag) { unsigned char bit=1<<(position-1); if(flag)//置1操作 { *p_data=*p...
分类:其他好文   时间:2015-06-09 17:14:32    阅读次数:90
字符窜右循环移位函数
#include #include void RightLoopMove(char *pStr, unsigned short steps) { int i = 0; int len = strlen(pStr); char a; while (steps) { a = pStr[len -1]; for (i = len - 1; i > 0; i--) { pS...
分类:其他好文   时间:2015-06-09 17:11:07    阅读次数:96
POJ 1061
#include//#define int unsigned#define unsigned long longusing namespace std;struct node{ long x; long y; unsigned a;};node ans;node euclid(un...
分类:其他好文   时间:2015-06-09 16:27:05    阅读次数:96
POJ 1183
#include#includeusing namespace std;int main(){ //freopen("acm.acm","r",stdin); unsigned long a; unsigned long m; unsigned long n; unsi...
分类:其他好文   时间:2015-06-09 15:37:54    阅读次数:120
POJ 1221
1 #include 2 #define MAXN 500 3 using namespace std; 4 5 unsigned dp[MAXN][MAXN]; 6 7 int main() 8 { 9 // freopen("acm.acm","r",stdin);10 i...
分类:其他好文   时间:2015-06-09 15:34:18    阅读次数:117
实现一个对8bit数据指定某一位置0或1
#include void bit_set(unsigned char *p_date, unsigned char position, int flag) { if (flag == 1) { *p_date |= (1 << (position - 1));//0000 0010或0000 0001 } // 00...
分类:其他好文   时间:2015-06-09 01:00:50    阅读次数:168
typedef关键字
typedef作用简介?我们可以使用typedef关键字为各种数据类型定义一个新名字(别名)。 1#include 23 typedef int Integer;4 typedef unsigned int UInterger;56 typedef float Float;78 int main(i...
分类:其他好文   时间:2015-06-08 16:34:31    阅读次数:84
pthread_t定义结构
linux下被定义为:在linux履行pthread_t它被定义为 "unsigned long int",参考这里Windows下这样定义: /* * Generic handle type - intended to extend uniqueness beyond *...
分类:其他好文   时间:2015-06-08 14:42:17    阅读次数:277
2.2.3 Runaround Numbers
没什么好说的强行搜索。具体细节看代码。代码如下:/*ID: awsd1231PROG: runroundLANG: C++*/#include#include#include#includeusing namespace std;unsigned long M;bool check(unsigned...
分类:其他好文   时间:2015-06-07 12:28:40    阅读次数:102
Java for LeetCode 191 Number of 1 Bits
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).For example, the 32-bit i...
分类:编程语言   时间:2015-06-06 23:17:35    阅读次数:152
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!