//实现对一个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
#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
#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
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
#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关键字为各种数据类型定义一个新名字(别名)。 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
linux下被定义为:在linux履行pthread_t它被定义为 "unsigned long int",参考这里Windows下这样定义: /* * Generic handle type - intended to extend uniqueness beyond *...
分类:
其他好文 时间:
2015-06-08 14:42:17
阅读次数:
277
没什么好说的强行搜索。具体细节看代码。代码如下:/*ID: awsd1231PROG: runroundLANG: C++*/#include#include#include#includeusing namespace std;unsigned long M;bool check(unsigned...
分类:
其他好文 时间:
2015-06-07 12:28:40
阅读次数:
102
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