摘要: 1、 #include <stdio.h> unsigned rrotate(unsigned x, int n) { printf("rrotate = %u\n", x >> n); } unsigned lrotate(unsigned x, int n) { printf("lrotate 阅读全文
posted @ 2021-05-18 21:30 小鲨鱼2018 阅读(40) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> #include <math.h> int main(void) { unsigned x; int n; puts("please input an unsigned number and an integer."); printf("x = "); s 阅读全文
posted @ 2021-05-18 19:56 小鲨鱼2018 阅读(63) 评论(0) 推荐(0) 编辑
摘要: c语言中按位逻辑运算符、位移运算符 #include <stdio.h> int count_bits(unsigned x) { int bits = 0; while(x) { if(x & 1U) bits++; x >>= 1; } return bits; } int int_bits(v 阅读全文
posted @ 2021-05-18 12:37 小鲨鱼2018 阅读(131) 评论(0) 推荐(0) 编辑
摘要: c语言中按位逻辑运算符、位移运算符 #include <stdio.h> int count_bits(unsigned x) { int bits = 0; while(x) { if(x & 1U) bits++; x >>= 1; } return bits; } int int_bits(v 阅读全文
posted @ 2021-05-18 12:35 小鲨鱼2018 阅读(119) 评论(0) 推荐(0) 编辑