上一页 1 ··· 143 144 145 146 147 148 149 150 151 ··· 367 下一页
摘要: 001、 #include <stdio.h> int count_1(unsigned x) //此处定义一个统计unsigned int型数据用二进制位表示时所有1的个数 { int count = 0; while(x) { if(x & 1U) { count++; } x >>= 1; } 阅读全文
posted @ 2022-08-18 02:14 小鲨鱼2018 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 001、 #include <stdio.h> int count_1(unsigned x) //定义统计unsigned int型数据二进制位1的个数的函数 { int count = 0; while(x) { if(x & 1U) { count++; } x >>= 1; } return 阅读全文
posted @ 2022-08-18 01:49 小鲨鱼2018 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 001、 #include <stdio.h> int main(void) { unsigned int x; printf("x = "); scanf("%u", &x); // 输出整数类数据 int count = 0; while(x) { if(x & 1U) // 判断x二进制表示时 阅读全文
posted @ 2022-08-18 01:05 小鲨鱼2018 阅读(72) 评论(0) 推荐(0) 编辑
摘要: c语言中 1u表示 unsigned int 型的1. 即无符号型的整数1. & : 在c语言中表示整数类中按位操作的逻辑与运算符。(按位操作的逻辑运算符& 不同于逻辑运算符&&) unsigned x & 1U: 判断x二进制表示时末尾的数字是0还是1; 如果x的二进制位的末尾是1, 则x & 1 阅读全文
posted @ 2022-08-18 00:43 小鲨鱼2018 阅读(2556) 评论(0) 推荐(0) 编辑
摘要: 001、 (base) root@PC1:/home/test4# ls test.py (base) root@PC1:/home/test4# cat test.py ## 测试程序 #!/usr/bin/python str1 = "AGCTTTTCATTCTGACTGCAACGGGCAATA 阅读全文
posted @ 2022-08-17 23:32 小鲨鱼2018 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 001、 capitalize将字符串的首字符转换为大写, 其余全部转换为小写 >>> str1 = "aaBBccEEff" >>> str1 'aaBBccEEff' >>> str1.capitalize() ## 将字符串首字符转换为大写, 其余全部转换为小写 'Aabbcceeff' 00 阅读全文
posted @ 2022-08-17 21:35 小鲨鱼2018 阅读(701) 评论(0) 推荐(0) 编辑
摘要: 001、 (base) root@PC1:/home/test4# ls test.py (base) root@PC1:/home/test4# cat test.py ## 测试程序 #!/usr/bin/python rna = "AUGGCCAUGGCGCCCAGAACUGAGAUCAAUA 阅读全文
posted @ 2022-08-17 20:46 小鲨鱼2018 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 001、列出当前工作目录 >>> import os >>> os.getcwd() ## 列出当前目录 '/home/test4' 002、修改工作目录 >>> os.chdir("/home/test3/") ## 修改当前的工作目录 >>> os.getcwd() '/home/test3' 阅读全文
posted @ 2022-08-17 18:44 小鲨鱼2018 阅读(54) 评论(0) 推荐(0) 编辑
摘要: 001、 (base) root@PC1:/home/test4# ls a.txt (base) root@PC1:/home/test4# cat a.txt ## 测试数据 ##1 ##2 ##3 4 i 6 y #kk mm a 9 7 6 (base) root@PC1:/home/tes 阅读全文
posted @ 2022-08-17 18:12 小鲨鱼2018 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 001、n (base) root@PC1:/home/test4# ls a.txt (base) root@PC1:/home/test4# cat a.txt 1 2 3 4 5 (base) root@PC1:/home/test4# sed 'n;p' a.txt ## n的作用是将两行作 阅读全文
posted @ 2022-08-17 17:05 小鲨鱼2018 阅读(308) 评论(0) 推荐(0) 编辑
上一页 1 ··· 143 144 145 146 147 148 149 150 151 ··· 367 下一页