上一页 1 ··· 282 283 284 285 286 287 288 289 290 ··· 367 下一页
摘要: 1、 #include <stdio.h> void multiply(int x[4][3], int y[3][4], int z[4][4]) { int i, j, k; for(i = 0; i < 4; i++) { for(j = 0; j < 4; j++) { for(k = 0; 阅读全文
posted @ 2021-05-11 11:32 小鲨鱼2018 阅读(46) 评论(0) 推荐(0) 编辑
摘要: 1、 #include <stdio.h> #define NUMBER 7 int search(const int x[], int y[], int key, int n) { int i, times = 0; for(i = 0; i < n; i++) { if(x[i] == key) 阅读全文
posted @ 2021-05-11 11:13 小鲨鱼2018 阅读(52) 评论(0) 推荐(0) 编辑
摘要: python中global关键字实现在函数内部对全局变量进行修改。 1、测试 >>> v = 10 >>> def test(): v = 5 print(v) >>> test() 5 >>> v ## 这说明在函数内部修改的全局变量只能在函数内部生效,不会真正影响全局变量 10 加global关 阅读全文
posted @ 2021-05-09 23:00 小鲨鱼2018 阅读(1187) 评论(0) 推荐(0) 编辑
摘要: R语言中sapply函数。 1、 x=c(1:5) x sapply(x,function(x) {x^2}) 阅读全文
posted @ 2021-05-07 22:53 小鲨鱼2018 阅读(1136) 评论(0) 推荐(0) 编辑
摘要: linux系统awk命令统计每一个用户进程占用的内存。 1、 [root@centos7 test2]# ps aux | awk 'NR != 1 {a[$1]+=$6} END{for(i in a) print i, a[i]}' geoclue 3096 rpc 104 rstudio+ 5 阅读全文
posted @ 2021-05-07 19:16 小鲨鱼2018 阅读(410) 评论(0) 推荐(0) 编辑
摘要: linux系统awk命令拆分文件。 1、 [root@centos7 test2]# ls file.txt [root@centos7 test2]# cat file.txt -rw-r--r-- 1 root 52457 Aug 10 2019 ngx_http.c -rw-r--r-- 1 阅读全文
posted @ 2021-05-07 18:58 小鲨鱼2018 阅读(592) 评论(0) 推荐(0) 编辑
摘要: c语言 6-5 #include <stdio.h> int sumup(int n) { int sum = 0; int i; for(i = 1; i <= n; i++) { sum += i; } return sum; } int main(void) { int i; puts("pl 阅读全文
posted @ 2021-05-07 10:14 小鲨鱼2018 阅读(71) 评论(0) 推荐(0) 编辑
摘要: c语言6-4 #include <stdio.h> int sqr(int a) { return a * a; } int pow4(int a) { return sqr(sqr(a)); } int main(void) { int i; puts("please input an integ 阅读全文
posted @ 2021-05-07 10:08 小鲨鱼2018 阅读(60) 评论(0) 推荐(0) 编辑
摘要: c语言 6-3 #include <stdio.h> int cube(int a) { return a * a * a; } int main(void) { int i; puts("please input an integer."); printf("i = "); scanf("%d", 阅读全文
posted @ 2021-05-07 10:03 小鲨鱼2018 阅读(69) 评论(0) 推荐(0) 编辑
摘要: 输出三个数中的最小值。 #include <stdio.h> int min3(int a, int b, int c) { int min = a; if(b < min) min = b; if(c < min) min = c; return min; } int main(void) { i 阅读全文
posted @ 2021-05-07 10:00 小鲨鱼2018 阅读(1627) 评论(0) 推荐(0) 编辑
上一页 1 ··· 282 283 284 285 286 287 288 289 290 ··· 367 下一页