摘要: 1.给定两个整形变量的值,将两个值的内容进行交换。 2. 不允许创建临时变量,交换两个数的内容(附加题) 3. 求10 个整数中最大值。 4. 写一个函数返回参数二进制中 1 的个数 比如: 15 0000 1111 4 个 1 程序原型: int count_one_... 阅读全文
posted @ 2016-03-15 18:06 午饭要阳光 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 1. 打印100~200 之间的素数 2. 输出乘法口诀表 3. 判断1000年---2000年之间的闰年 #include #include #include int main() { int count = 0; int div = 0; printf("输出100—200之间的素数\n... 阅读全文
posted @ 2016-03-15 17:58 午饭要阳光 阅读(315) 评论(0) 推荐(0) 编辑
摘要: 求一个整数所对应的二进制中有多少个bit位为一 #include #include int count_one_bits(unsigned int value) { int count = 0; for (int i = 0; i > 1; } return count; } int... 阅读全文
posted @ 2016-03-15 00:35 午饭要阳光 阅读(124) 评论(0) 推荐(0) 编辑