上一页 1 ··· 141 142 143 144 145 146 147 148 149 ··· 367 下一页
摘要: 001、 dat3 <- matrix(1:16, nrow = 4, byrow = T) dat3 min(dat3) mean(dat3) max(dat3) dat3[] <- 0 ## 将矩阵元素全部设置为0(可以为任意元素) dat3 阅读全文
posted @ 2022-08-21 23:48 小鲨鱼2018 阅读(368) 评论(0) 推荐(0) 编辑
摘要: 001、删除第一列 (base) root@PC1:/home/test# cat test.txt 1 MIR1302-10 1 2 FAM138A 2 3 OR4F5 3 4 RP11-34P13.7 4 5 RP11-34P13.8 5 6 AL627309.1 6 7 RP11-34P13. 阅读全文
posted @ 2022-08-21 23:28 小鲨鱼2018 阅读(1421) 评论(0) 推荐(0) 编辑
摘要: 001、 >>> [[0] * 5 for i in range(3)] ## 生成3行5列,元素为0的矩阵 [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]] 002、 >>> [ [1, 2, 3] * 2 for i in range(6)] 阅读全文
posted @ 2022-08-20 01:38 小鲨鱼2018 阅读(292) 评论(0) 推荐(0) 编辑
摘要: pyhton 中内置函数enumerate用于将序列生成二元组。 001、 >>> str1 = "hello!" ## 测试字符串 >>> for i in enumerate(str1): ## enumerate用于将序列生成二元组 ... print(i) ... (0, 'h') (1, 阅读全文
posted @ 2022-08-20 01:18 小鲨鱼2018 阅读(37) 评论(0) 推荐(0) 编辑
摘要: 001、 >>> test1 = [] >>> test1 [] >>> if not test1: ## 判断列表为空 ... print("no element") ... no element 002、 >>> test1 = () >>> test1 () >>> if not test1: 阅读全文
posted @ 2022-08-20 01:05 小鲨鱼2018 阅读(521) 评论(0) 推荐(0) 编辑
摘要: 001、读取fasta文件 root@PC1:/home/test# ls a.fasta root@PC1:/home/test# cat a.fasta ## 测试数据 >Rosalind_1 ATCCAGCT >Rosalind_2 GGGCAACT >Rosalind_3 ATGGATCT 阅读全文
posted @ 2022-08-20 00:38 小鲨鱼2018 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 001、 #include <stdio.h> int test(int n) // 定义函数 { if(n > 0) { return n * test(n - 1); // 调用函数自身, 终止条件是n = 0 } else { return 1; } } int main(void) { in 阅读全文
posted @ 2022-08-19 00:56 小鲨鱼2018 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 001、 #include <stdio.h> enum set01 {aaa, bbb, ccc, ddd}; // 表示一定整数值的集合的枚举类型。0, 1, 2, 3 int main(void) { printf("aaa: %d\n", aaa); printf("bbb: %d\n", 阅读全文
posted @ 2022-08-19 00:20 小鲨鱼2018 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 001、 #include <stdio.h> #define NUMBER 5 void psort(int x[], int n) { int i, j; for(i = 0; i < n - 1; i++) //冒泡排序法, 外层循环每循环一次,将最大值,移动至最左端 { for(j = n 阅读全文
posted @ 2022-08-18 23:29 小鲨鱼2018 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 001、 #include <stdio.h> #define xxx(str) {putchar('\a'); puts(str);} // 函数使用; 花括号内为完整的代码块,末尾有分号, 因此main函数ti第一个if之后不再加分号; int main(void) { int i; print 阅读全文
posted @ 2022-08-18 23:02 小鲨鱼2018 阅读(88) 评论(0) 推荐(0) 编辑
上一页 1 ··· 141 142 143 144 145 146 147 148 149 ··· 367 下一页