上一页 1 ··· 284 285 286 287 288 289 290 291 292 ··· 367 下一页
摘要: c语言中实现矩阵的转置 1、 #include <stdio.h> int main(void) { int i, j, a[4][6], b[6][4]; puts("please input the elements of matrix a."); for(i = 0; i < 4; i++) 阅读全文
posted @ 2021-05-03 12:07 小鲨鱼2018 阅读(1739) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> int main(void) { int i, j, a[6][2]; puts("please input the elements of the array."); for(i = 0; i < 6; i++) { for(j = 0; j < 2; 阅读全文
posted @ 2021-05-03 11:35 小鲨鱼2018 阅读(48) 评论(0) 推荐(0) 编辑
摘要: c语言中计算矩阵的乘积。 矩阵相乘的条件:左侧矩阵的列数等于右侧矩阵的行数。 矩阵相乘的结果:行数为左侧矩阵的行数,列数为右侧矩阵的列数。 #include <stdio.h> int main(void) { int i, j, k, a[4][6], b[6][7], c[4][7] = {0} 阅读全文
posted @ 2021-05-03 10:21 小鲨鱼2018 阅读(1095) 评论(0) 推荐(0) 编辑
摘要: python中字符串拼接的三种方法。 1、加号拼接 >>> a = "abcd" >>> b = "xyzm" >>> a 'abcd' >>> b 'xyzm' >>> a + b 'abcdxyzm' 2、join拼接 >>> c = ["abcd","xyzm"] >>> c ['abcd', 阅读全文
posted @ 2021-05-01 23:16 小鲨鱼2018 阅读(599) 评论(0) 推荐(0) 编辑
摘要: python中字符串的格式化。 1、format 位置参数 >>> "{0} and {1}".format("aaa","bbb") 'aaa and bbb' >>> "{0},{1} and {2}".format("aaa","bbb","ccc") 'aaa,bbb and ccc' 关键 阅读全文
posted @ 2021-05-01 23:11 小鲨鱼2018 阅读(142) 评论(0) 推荐(0) 编辑
摘要: python中字符串的拼接。 1、 >>> test1 = ["aaa","bbb","ccc","ddd","eee"] >>> test1 ['aaa', 'bbb', 'ccc', 'ddd', 'eee'] >>> "-".join(test1) 'aaa-bbb-ccc-ddd-eee' 阅读全文
posted @ 2021-05-01 22:56 小鲨鱼2018 阅读(64) 评论(0) 推荐(0) 编辑
摘要: 1、问题 [root@centos7 Python-3.9.4]# ln -s python /usr/bin/python [root@centos7 Python-3.9.4]# python -bash: /usr/bin/python: Too many levels of symbolic 阅读全文
posted @ 2021-05-01 22:52 小鲨鱼2018 阅读(2968) 评论(0) 推荐(0) 编辑
摘要: python中拆分字符串 1、 >>> test1 = "abxcdxefxfh" >>> test1 'abxcdxefxfh' >>> test1.split(sep = "x") ['ab', 'cd', 'ef', 'fh'] 阅读全文
posted @ 2021-05-01 21:51 小鲨鱼2018 阅读(381) 评论(0) 推荐(0) 编辑
摘要: python中替换字符串中特定字符。 1、 >>> test1 = "abdadcadadfa" >>> test1 'abdadcadadfa' >>> test1.replace("a","x") 'xbdxdcxdxdfx' >>> test1.replace("a","x",2) ## 指定 阅读全文
posted @ 2021-05-01 21:48 小鲨鱼2018 阅读(2657) 评论(0) 推荐(0) 编辑
摘要: 1、返回第一个出现的索引 >>> test1 'absacaxy' >>> test1.find("a") 0 2、返回特定字符的所有索引 >>> test1 'absacaxy' >>> b = test1.count("a") >>> c = -1 >>> for i in range(b): 阅读全文
posted @ 2021-05-01 21:34 小鲨鱼2018 阅读(3760) 评论(0) 推荐(0) 编辑
上一页 1 ··· 284 285 286 287 288 289 290 291 292 ··· 367 下一页