01 2021 档案

摘要:1、问题 [root@localhost home]# yum install httpd Loaded plugins: langpacks, product-id, subscription-manager This system is not registered to Red Hat Sub 阅读全文
posted @ 2021-01-31 13:24 小鲨鱼2018 阅读(3112) 评论(0) 推荐(0) 编辑
摘要:1、直接安装报错 当前系统为rhel7.0 [root@localhost home]# yum install epel-release Loaded plugins: langpacks, product-id, subscription-manager This system is not r 阅读全文
posted @ 2021-01-31 13:13 小鲨鱼2018 阅读(1449) 评论(0) 推荐(0) 编辑
摘要:1、查看系统信息 [root@localhost home]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.9 (Maipo) [root@localhost home]# lsb_release -a LSB 阅读全文
posted @ 2021-01-31 00:19 小鲨鱼2018 阅读(3137) 评论(0) 推荐(0) 编辑
摘要:1、查看系统版本 [root@centos7PC1 home]# lsb_release -a LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4. 阅读全文
posted @ 2021-01-30 16:16 小鲨鱼2018 阅读(794) 评论(0) 推荐(0) 编辑
摘要:1、 [root@PC3 test]# uname -a Linux PC3 3.10.0-123.el7.x86_64 #1 SMP Mon May 5 11:16:57 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux 2、 [root@PC3 test]# cat 阅读全文
posted @ 2021-01-30 14:58 小鲨鱼2018 阅读(437) 评论(0) 推荐(0) 编辑
摘要:1、awk命令 [root@PC3 test]# cat a.txt dfs dsafd d fgasdf safd ge [root@PC3 test]# awk -F "" '{print NF}' a.txt 3 5 1 6 4 2 2、 [root@PC3 test]# cat a.txt 阅读全文
posted @ 2021-01-30 11:57 小鲨鱼2018 阅读(7023) 评论(0) 推荐(0) 编辑
摘要:1、 [root@PC3 sheep]# ls a.ped result.map result.ped tr.map [root@PC3 sheep]# ls -S | xargs -n 1 du -sh ## 从大致小进行排序 829M result.ped 204M a.ped 20M resu 阅读全文
posted @ 2021-01-30 11:45 小鲨鱼2018 阅读(305) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 [root@PC3 test]# cat a.txt 34 rtd 78 98 fgg 345 23 fgg 668 45 dfs 23 10 fsd 35 77 jla 35 87 saf 45 53 sfg 2334 46 wrt 098 2、awk命令显示特定列 [root@PC 阅读全文
posted @ 2021-01-29 22:34 小鲨鱼2018 阅读(341) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 [root@PC3 test]# cat a.txt 1 e abc 2 f a 3 x g 4 w p 5 q k 6 w f 7 x F 8 m y 9 c t 2、匹配特定字符串 [root@PC3 test]# cat a.txt 1 e abc 2 f a 3 x g 4 w 阅读全文
posted @ 2021-01-29 20:45 小鲨鱼2018 阅读(440) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 [root@PC3 test]# cat a.txt 1234567849 1234567849 1234567849 1234567849 2、删除前几个字符 [root@PC3 test]# sed 's/..//' a.txt ## 删除前两个字符 34567849 345678 阅读全文
posted @ 2021-01-29 20:03 小鲨鱼2018 阅读(20644) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 [root@PC3 test]# cat a.txt Beijing 2003 Beijing 2004 Beijing 2005 Beijing 2006 Beijing 2005 Beijing 2008 [root@PC3 test]# cat c.txt 1 2 3 4 5 6 阅读全文
posted @ 2021-01-29 13:51 小鲨鱼2018 阅读(621) 评论(0) 推荐(0) 编辑
摘要:1、 [root@PC3 test]# cat c.txt 1 2 3 4 5 6 7 8 9 10 2、将2替换为xxxx,将5替换为yyyy,将7替换为zzz,删除匹配9的行,在第一行前增加first [root@PC3 test]# sed 's/2/xxxx/; s/5/yyyy/; s/7 阅读全文
posted @ 2021-01-29 13:41 小鲨鱼2018 阅读(153) 评论(0) 推荐(1) 编辑
摘要:1、测试数据 [root@PC3 test]# cat c.txt 1 2 3 4 5 6 7 8 9 10 2、提取包含2的行,其后1行,其后2行 [root@PC3 test]# sed -n '/2/p' c.txt 2 [root@PC3 test]# sed -n '/2/,+1p' c. 阅读全文
posted @ 2021-01-29 13:31 小鲨鱼2018 阅读(3822) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 [root@PC3 test]# cat b.txt e t 3 d g 2 k 8 p m 9 p 5 7 8 m i o e t d 2、awk加行号 [root@PC3 test]# awk '{print NR,$p}' b.txt 1 e t 3 2 d g 2 3 k 8 阅读全文
posted @ 2021-01-29 12:19 小鲨鱼2018 阅读(1240) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 [root@PC3 test]# cat b.txt e t 3 d g 2 k 8 p m 9 p 5 7 8 m i o e t d 2、删除包含m的行 [root@PC3 test]# sed '/m/d' b.txt e t 3 d g 2 k 8 p 5 7 8 e t d 阅读全文
posted @ 2021-01-29 12:13 小鲨鱼2018 阅读(2386) 评论(0) 推荐(0) 编辑
摘要:1、测试数据如下: [root@PC3 test]# cat a.txt 1 Beijing 2003 2 Beijing 2004 3 Beijing 2005 4 Beijing 2006 5 Beijing 2007 6 Beijing 2008 7 Beijing 2007 8 Beijin 阅读全文
posted @ 2021-01-29 12:04 小鲨鱼2018 阅读(4306) 评论(0) 推荐(0) 编辑
摘要:1、测试数据 [root@PC3 test]# cat a.txt 3 a d 9 k x 2 h 0 c 3 k 1 z c 3 7 5 2、 [root@PC3 test]# grep -v "k" a.txt 3 a d 2 h 0 1 z c 3 7 5 3、 [root@PC3 test] 阅读全文
posted @ 2021-01-28 23:14 小鲨鱼2018 阅读(2322) 评论(0) 推荐(0) 编辑
摘要:1、 [root@PC3 test]# ls [root@PC3 test]# ls /home/sheep/ result.map result.ped [root@PC3 test]# cp /home/sheep/{result.map,result.ped} . [root@PC3 test 阅读全文
posted @ 2021-01-28 19:05 小鲨鱼2018 阅读(672) 评论(0) 推荐(0) 编辑
摘要:1、 par(mai=c(2,2,2,2)) plot(1:10) legend(1,-1,"aaa",xpd=TRUE,box.lwd = 3, pch=15) legend(11,11,"bbb",xpd=TRUE,box.lwd = 3, pch=15) 2、 par(mai=c(2,2,2, 阅读全文
posted @ 2021-01-28 12:07 小鲨鱼2018 阅读(7679) 评论(0) 推荐(0) 编辑
摘要:1、 [root@PC3 test]# lsb_release -a bash: lsb_release: command not found... 2、 [root@PC3 test]# yum install -y redhat-lsb Loaded plugins: langpacks, pr 阅读全文
posted @ 2021-01-28 10:36 小鲨鱼2018 阅读(95) 评论(0) 推荐(0) 编辑
摘要:1、 [root@PC3 yum.repos.d]# java -version java version "1.7.0_51" OpenJDK Runtime Environment (rhel-2.4.5.5.el7-x86_64 u51-b31) OpenJDK 64-Bit Server V 阅读全文
posted @ 2021-01-27 22:44 小鲨鱼2018 阅读(905) 评论(0) 推荐(0) 编辑
摘要:1、 setwd("C:/Users/75377/Desktop/SHEEP_ROH") png("12.png",width = 7000,height = 5500,pointsize = 170) par(mai = c(12,12,12,12),mgp = c(2.1,0.5,0)) #地图 阅读全文
posted @ 2021-01-24 23:57 小鲨鱼2018 阅读(609) 评论(0) 推荐(0) 编辑
摘要:1、 > library(REmap) > options(remap.ak = "此处输入个人秘钥") > city_vec = c("Beijing","Haerbin","Shanghai","Guangzhou") > get_city_coord("Shanghai") [1] 121.4 阅读全文
posted @ 2021-01-24 22:23 小鲨鱼2018 阅读(1140) 评论(0) 推荐(0) 编辑
摘要:plot(1:10,xlab = expression (paste("xxx ",R[2], " (","xx", ")"))) 阅读全文
posted @ 2021-01-19 23:45 小鲨鱼2018 阅读(1742) 评论(0) 推荐(0) 编辑
摘要:> a <- c(2,5,6,7) > b <- c(6,3,2,9) > c = rbind(a,b) > c [,1] [,2] [,3] [,4] a 2 5 6 7 b 6 3 2 9 > class(c) [1] "matrix" "array" > c <- data.frame(c) 阅读全文
posted @ 2021-01-12 15:02 小鲨鱼2018 阅读(1554) 评论(0) 推荐(0) 编辑
摘要:1、 > a <- c(3,NA,NA,4,1,5) > b <- c(NA,4,6,2,4,9) > c <- data.frame(a,b) > c a b 1 3 NA 2 NA 4 3 NA 6 4 4 2 5 1 4 6 5 9 > c[is.na(c)] <- 0 > c a b 1 3 阅读全文
posted @ 2021-01-12 14:30 小鲨鱼2018 阅读(11266) 评论(0) 推荐(0) 编辑
摘要:1、 p<-ggplot(mtcars,aes(mpg,hp,colour=factor(cyl)))+geom_point() p 2、隐去x轴 p + xlab(NULL) 3、 隐去y轴 p + ylab(NULL) 阅读全文
posted @ 2021-01-10 15:06 小鲨鱼2018 阅读(545) 评论(0) 推荐(0) 编辑
摘要:1、 p<-ggplot(mtcars,aes(mpg,hp,colour=factor(cyl)))+geom_point() p 2、调整x轴 p+theme(axis.title.x=element_text(vjust=2, size=20,face = "bold")) p+theme(a 阅读全文
posted @ 2021-01-10 13:37 小鲨鱼2018 阅读(20086) 评论(0) 推荐(0) 编辑
摘要:1、 library(gcookbook) library(ggplot2) p=ggplot(heightweight,aes(x=sex,y=heightIn))+geom_violin() p 2、指定x轴因子水平顺序 heightweight$sex<-factor(heightweight 阅读全文
posted @ 2021-01-10 13:11 小鲨鱼2018 阅读(2496) 评论(0) 推荐(0) 编辑
摘要:1、 p<-ggplot(mtcars,aes(mpg,hp,colour=factor(cyl)))+geom_point() p 2、调整绘图边框的粗细 p + theme(panel.border = element_rect(fill=NA,color="black", size=5, li 阅读全文
posted @ 2021-01-10 12:44 小鲨鱼2018 阅读(17869) 评论(0) 推荐(0) 编辑
摘要:1、 p<-ggplot(mtcars,aes(mpg,hp,colour=factor(cyl)))+geom_point() p 2、调整x轴 p+theme(axis.line.x=element_line(linetype=1,color="black",size=3)) 3、调整x轴刻度线 阅读全文
posted @ 2021-01-10 12:38 小鲨鱼2018 阅读(15181) 评论(2) 推荐(2) 编辑
摘要:1、 p<-ggplot(mtcars,aes(mpg,hp,colour=factor(cyl)))+geom_point() p 2、去除图例 p + theme(legend.position = 'none') 阅读全文
posted @ 2021-01-10 12:22 小鲨鱼2018 阅读(14007) 评论(0) 推荐(0) 编辑
摘要:1、 p<-ggplot(mtcars,aes(mpg,hp,colour=factor(cyl)))+geom_point() p 2、去除背景色 p + theme_bw() 3、去除网格线 p + theme_bw() + theme(panel.grid=element_blank()) 阅读全文
posted @ 2021-01-10 12:19 小鲨鱼2018 阅读(28039) 评论(0) 推荐(1) 编辑
摘要:1、 #include <stdio.h> #define NUMBER 7 int main(void) { int i, a[NUMBER]; for (i = 0; i < NUMBER; i ++) { printf("NO.[%d] = ", i + 1); scanf("%d", &a[ 阅读全文
posted @ 2021-01-09 13:44 小鲨鱼2018 阅读(144) 评论(0) 推荐(0) 编辑
摘要:#include <stdio.h> int main(void) { int a[7] = {45,32,86,56,24,98,85}; int min, max; min = a[0]; max = a[0]; int i; for (i = 0; i < 7; i ++) { if (a[i 阅读全文
posted @ 2021-01-09 12:55 小鲨鱼2018 阅读(6590) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> #define NUMBER 5 int main(void) { int i; int sum = 0; int a[NUMBER]; puts("please input the scores."); for (i = 0; i < NUMBER; i 阅读全文
posted @ 2021-01-09 12:36 小鲨鱼2018 阅读(173) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int a[7] = {100,200,300,400,500,600,700}; int i; for (i = 0; i < 3; i ++) { int temp = a[i]; a[i] = a[6 - i]; a 阅读全文
posted @ 2021-01-08 23:33 小鲨鱼2018 阅读(1462) 评论(0) 推荐(0) 编辑
摘要:#include <stdio.h> int main(void) { int a[5]; int i; for (i = 0; i < 5; i ++) { printf("a[%d] : ", i); scanf("%d", &a[i]); } puts("\n "); for (i = 0; 阅读全文
posted @ 2021-01-08 22:46 小鲨鱼2018 阅读(3907) 评论(0) 推荐(0) 编辑
摘要:#include <stdio.h> int main(void) { int a[4] = {22,11,99,77}; int b[4]; int i; for (i = 0; i < 4; i ++) b[i] = a[i]; puts(" a b"); for (i = 0; i < 4; 阅读全文
posted @ 2021-01-08 22:35 小鲨鱼2018 阅读(1172) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int v[5]; v[0] = 1; v[1] = 2; v[2] = 3; v[3] = 4; v[4] = 5; printf("v[0] = %d\n", v[0]); printf("v[1] = %d\n", 阅读全文
posted @ 2021-01-08 20:38 小鲨鱼2018 阅读(532) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int i, j, x, y, z; do { puts("please input an integer."); printf("x = "); scanf("%d", &x); } while (x < 0 || x 阅读全文
posted @ 2021-01-08 16:17 小鲨鱼2018 阅读(1058) 评论(0) 推荐(0) 编辑
摘要:#include <stdio.h> int main(void) { int i, j; for (i = 1; i <= 9; i ++ ) { for (j = 1; j <= 9; j ++) { int k = i * j; if (k % 10 == 4 || k / 10 == 4) 阅读全文
posted @ 2021-01-08 14:45 小鲨鱼2018 阅读(283) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int i, j, len; puts("please input the len."); printf("len = "); scanf("%d", &len); for (i = 1; i <= len; i ++ ) 阅读全文
posted @ 2021-01-08 13:22 小鲨鱼2018 阅读(1685) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int i, j, len; puts("please input the len."); printf("len = "); scanf("%d", &len); for (i = 1; i <= len; i ++) 阅读全文
posted @ 2021-01-08 13:06 小鲨鱼2018 阅读(3754) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int i, j; for (i = 1; i <= 9; i ++) { for (j = 1; j <= 9; j ++) { printf("%3d", i * j); } putchar('\n'); } retu 阅读全文
posted @ 2021-01-08 11:18 小鲨鱼2018 阅读(251) 评论(0) 推荐(0) 编辑
摘要:#include <stdio.h> int main(void) { int label; do { int i; do { puts("please input an integer."); printf("i = "); scanf("%d", &i); if (i <= 0) printf( 阅读全文
posted @ 2021-01-07 23:57 小鲨鱼2018 阅读(232) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int i, j, len; puts("please input the len."); printf("len = "); scanf("%d", &len); for (i = 1; i <= len; i ++ ) 阅读全文
posted @ 2021-01-07 19:27 小鲨鱼2018 阅读(3544) 评论(0) 推荐(0) 编辑
摘要:#include <stdio.h> int main(void) { int i, j, m, n; puts("please input two integers."); printf("m = "); scanf("%d", &m); printf("n = "); scanf("%d", & 阅读全文
posted @ 2021-01-07 19:09 小鲨鱼2018 阅读(1511) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int i; for (i = 1; i <= 9; i ++) { printf("%3d", i); } printf("\n"); return 0; } ↓ #include <stdio.h> int main( 阅读全文
posted @ 2021-01-07 18:23 小鲨鱼2018 阅读(2559) 评论(0) 推荐(0) 编辑
摘要:#include <stdio.h> int main(void) { int i, j; printf("j = "); scanf("%d", &j); for (i = 1; i <= j; i ++ ) { if (i % 3 == 0) { putchar('*'); putchar('\ 阅读全文
posted @ 2021-01-07 14:59 小鲨鱼2018 阅读(390) 评论(0) 推荐(0) 编辑
摘要:#include <stdio.h> int main(void) { int i, j; printf("j = "); scanf("%d", &j); for (i = 1; i <= j; i++ ) { if (j % i == 0) printf("%d\n", i); } return 阅读全文
posted @ 2021-01-07 14:30 小鲨鱼2018 阅读(127) 评论(0) 推荐(0) 编辑
摘要:#include <stdio.h> int main(void) { int start, end, intervals; puts("please input three integers."); printf("start = "); scanf("%d", &start); printf(" 阅读全文
posted @ 2021-01-07 14:08 小鲨鱼2018 阅读(1417) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int i, num; puts("please input an integer."); printf("num = "); scanf("%d", &num); for (i = 1; i <= num; i++) { 阅读全文
posted @ 2021-01-07 13:47 小鲨鱼2018 阅读(1625) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int i, num, sum = 0; puts("please input an integer."); printf("num = "); scanf("%d", &num); for (i = 1; i <= nu 阅读全文
posted @ 2021-01-07 13:32 小鲨鱼2018 阅读(925) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int num, counts, temp; int sum =0; puts("please input an num."); printf("num = "); scanf("%d", &num); for (coun 阅读全文
posted @ 2021-01-07 13:13 小鲨鱼2018 阅读(1594) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int i = 10; while (1) { printf("%d\n", i++); if ( i == 20) break; } return 0; } 2、 #include <stdio.h> int main( 阅读全文
posted @ 2021-01-07 12:27 小鲨鱼2018 阅读(674) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int i = 100; while (1) { printf("%d\n", i); } return 0; } 2、 #include <stdio.h> int main(void) { int i = 10; fo 阅读全文
posted @ 2021-01-07 12:22 小鲨鱼2018 阅读(3297) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int i; puts("please input an integer."); printf("i = "); scanf("%d", &i); for (i < 0; i ++;) printf("%d\n", i); 阅读全文
posted @ 2021-01-07 11:04 小鲨鱼2018 阅读(186) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int i,j; puts("please input an integer."); printf("j = "); scanf("%d", &j); for (i = 1; i <= j; i ++) printf("% 阅读全文
posted @ 2021-01-06 23:55 小鲨鱼2018 阅读(487) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int i = 0, j; puts("please input an integer."); printf("j = "); scanf("%d", &j); while (i < j) { printf("%d\n", 阅读全文
posted @ 2021-01-06 13:37 小鲨鱼2018 阅读(153) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int i,k; do { puts("please input an integer."); printf("i = "); scanf("%d", &i); } while (i <= 0); //此处 do whil 阅读全文
posted @ 2021-01-06 00:05 小鲨鱼2018 阅读(1171) 评论(3) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int i; do { puts("please input an integer."); printf("i = "); scanf("%d", &i); } while (i <= 0); while (i > 0) 阅读全文
posted @ 2021-01-05 23:23 小鲨鱼2018 阅读(159) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int i = 0; while (i < 5) { printf("%d.\n", i++); } return 0; }## 后置递增运算表达式的值: 递增之前的值 2、 #include <stdio.h> int 阅读全文
posted @ 2021-01-05 21:52 小鲨鱼2018 阅读(253) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int i = 5; while (i > 0) { printf("%d.\n", i--); } return 0; }## 后置递减表达式的值: 递减之前的值 2、 #include <stdio.h> int ma 阅读全文
posted @ 2021-01-05 21:45 小鲨鱼2018 阅读(210) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int num; int counts = 0, sum = 0; int temp; puts("please input an integer."); printf("num = "); scanf("%d", &nu 阅读全文
posted @ 2021-01-05 20:48 小鲨鱼2018 阅读(1217) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int i; puts("please input an integer."); printf("i = "); scanf("%d", &i); while (i > 0) { putchar('*'); i = i - 阅读全文
posted @ 2021-01-05 19:37 小鲨鱼2018 阅读(132) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int i; puts("please input an integer."); printf("i = "); scanf("%d", &i); while (i > 0) { printf("hello world!\ 阅读全文
posted @ 2021-01-05 18:38 小鲨鱼2018 阅读(1284) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { printf("%f", pow(2,3)); return 0; } ↓ #include <stdio.h> int main(void) { double i = 2, j = 4; printf("%f", pow 阅读全文
posted @ 2021-01-05 15:13 小鲨鱼2018 阅读(3911) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { double i; puts("please input an integer."); printf("i = "); scanf("%lf", &i); double j = 1; while (pow(2.0,j) < 阅读全文
posted @ 2021-01-05 15:01 小鲨鱼2018 阅读(240) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int i; puts("please input an integer."); printf("i = "); scanf("%d", &i); int j = 0; while (i >= j) { printf("% 阅读全文
posted @ 2021-01-05 13:27 小鲨鱼2018 阅读(209) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int i; puts("please input an integer."); printf("i = "); scanf("%d", &i); while (i >= 1) { printf("%d.\n", i); 阅读全文
posted @ 2021-01-05 11:34 小鲨鱼2018 阅读(705) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int sum = 0; int counts = 0; int label; do { int i; puts("please input an integer."); printf("i = "); scanf("%d 阅读全文
posted @ 2021-01-05 00:10 小鲨鱼2018 阅读(490) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int a,b; puts("please input two integers."); printf("a = "), scanf("%d", &a); printf("b = "), scanf("%d", &b); 阅读全文
posted @ 2021-01-04 14:56 小鲨鱼2018 阅读(2384) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int label; int sum = 0; int counts = 0; do { int i; puts("please input the number i."); printf("i = "); scanf(" 阅读全文
posted @ 2021-01-04 14:07 小鲨鱼2018 阅读(1636) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int i; do { puts("please input value of i (0/1/2)"); printf("i = "); scanf("%d", &i); } while (i < 0 || i > 2); 阅读全文
posted @ 2021-01-04 13:09 小鲨鱼2018 阅读(123) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int x; do { int i; puts("please input an integer."); printf("i = "); scanf("%d", &i); if (i % 2 == 0) puts("eve 阅读全文
posted @ 2021-01-04 11:46 小鲨鱼2018 阅读(1033) 评论(0) 推荐(0) 编辑
摘要:1、 #include <stdio.h> int main(void) { int i; puts("please input an integer."); printf("i = "); scanf("%d", &i); if (i % 3 == 0) puts("can be devided" 阅读全文
posted @ 2021-01-03 23:40 小鲨鱼2018 阅读(964) 评论(0) 推荐(0) 编辑
摘要:>>> tag = True >>> test1 = {} >>> type(test1) <class 'dict'> >>> while tag: name = input("please input your name: ") mountain = input("which mountain 阅读全文
posted @ 2021-01-02 19:46 小鲨鱼2018 阅读(117) 评论(0) 推荐(0) 编辑
摘要:1、 >>> test1 = ["aa","bb","aa","cc","aa","cc","dd","ee"] >>> test1 ['aa', 'bb', 'aa', 'cc', 'aa', 'cc', 'dd', 'ee'] >>> "aa& 阅读全文
posted @ 2021-01-02 19:10 小鲨鱼2018 阅读(615) 评论(0) 推荐(0) 编辑
摘要:1、 >>> a = {} >>> while a != "quit": a = input("please input an incredient:") if a != "quit": print(f"{a} will be added!!") please input an incredient 阅读全文
posted @ 2021-01-02 14:28 小鲨鱼2018 阅读(87) 评论(0) 推荐(0) 编辑
摘要:>>> while True: a = input("please input something:") if a == "ab": break else: print(f"you had input {a}.") please input something:100 you had input 1 阅读全文
posted @ 2021-01-02 13:41 小鲨鱼2018 阅读(141) 评论(0) 推荐(0) 编辑
摘要:1、 >>> tag = True >>> while tag: a = input("please input something : ") if a == "quit": tag = False else: print(a) please input something : 100 100 pl 阅读全文
posted @ 2021-01-02 13:20 小鲨鱼2018 阅读(306) 评论(0) 推荐(0) 编辑
摘要:1、 >>> a = "" >>> while a != "quit": a = input("please input a str or 'quit' to leave: ") print(a) please input a str or 'quit' to leave: 100 100 plea 阅读全文
posted @ 2021-01-02 12:38 小鲨鱼2018 阅读(103) 评论(0) 推荐(0) 编辑
摘要:>>> for i in range(1,11): if i % 4 == 0: print(i) 4 8 >>> for i in range(1,11): if i % 4 == 0: break print(i) 1 2 3 >>> for i in range(1,11): if i % 4 阅读全文
posted @ 2021-01-02 11:15 小鲨鱼2018 阅读(82) 评论(0) 推荐(0) 编辑
摘要:1、 >>> i = 1 >>> sum = 0 >>> while i <= 100: sum = sum + i i = i + 1 ## 当此处i等于101时循环停止 >>> print(sum) 5050 2、 >>> a = 100 >>> b = int(input("please in 阅读全文
posted @ 2021-01-02 10:43 小鲨鱼2018 阅读(116) 评论(0) 推荐(0) 编辑
摘要:1、 >>> test1 = dict(key1="aaa",key2="bbb",key3="ccc",key4="ddd") >>> test1 {'key1': 'aaa', 'key2': 'bbb', 'key3': 'ccc', 'key4': 'ddd'} >>> del test1[ 阅读全文
posted @ 2021-01-01 20:14 小鲨鱼2018 阅读(4145) 评论(0) 推荐(0) 编辑
摘要:1、 >>> a = dict(zip(["one","two","three"],[100,200,300])) >>> a {'one': 100, 'two': 200, 'three': 300} >>> b = a >>> b {'one': 100, 'two': 200, 'three 阅读全文
posted @ 2021-01-01 19:47 小鲨鱼2018 阅读(379) 评论(0) 推荐(0) 编辑
摘要:>>> test1 = ["aaa","bbb","ccc","ddd"] >>> test2 = [111,222,333,444] >>> test3 = {} >>> for i in zip(test1,test2): test3[i[0]]=i[1] >>> test3 {'aaa': 1 阅读全文
posted @ 2021-01-01 19:07 小鲨鱼2018 阅读(1115) 评论(0) 推荐(0) 编辑
摘要:>>> test1 = [100,300,500,1000] >>> test2 = [350,550,300,350] >>> for i in zip(test1,test2): i[0] + i[1] 450 850 800 1350 阅读全文
posted @ 2021-01-01 19:03 小鲨鱼2018 阅读(382) 评论(0) 推荐(0) 编辑
摘要:>>> test1 = dict(key1="xx",key2="yy",key3="aa",key4="bb",key5="cc",key6="dd") >>> type(test1) <class 'dict'> >>> len(test1) 6 >>> test2=["key3","key5" 阅读全文
posted @ 2021-01-01 18:35 小鲨鱼2018 阅读(7160) 评论(0) 推荐(0) 编辑
摘要:>>> test1 = dict(key8="ccc",key3="ete",key2="iii",key4 = "wwww") >>> type(test1) <class 'dict'> >>> len(test1) 4 >>> for i,j in test1.items(): print(i 阅读全文
posted @ 2021-01-01 18:00 小鲨鱼2018 阅读(673) 评论(0) 推荐(0) 编辑
摘要:1、 >>> test1 = dict(key1="xxx",key2="aaa",key3=100,key="abc") >>> test1 {'key1': 'xxx', 'key2': 'aaa', 'key3': 100, 'key': 'abc'} >>> type(test1) <cla 阅读全文
posted @ 2021-01-01 17:50 小鲨鱼2018 阅读(241) 评论(0) 推荐(0) 编辑
摘要:>>> test1 = {"zhangsan":["java","c","python"],"lisi":["c++","golang"],"wangwu":["c","java","python","javascript"]} >>> type(test1) <class 'dict'> &g 阅读全文
posted @ 2021-01-01 12:28 小鲨鱼2018 阅读(1468) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示