摘要: 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) 编辑