码迷,mamicode.com
首页 >  
搜索关键字:Shell printf    ( 43065个结果
linux shell命令之脚本要有足够的提示
一个有参数但无提示说明的脚本#login1.sh: 用户登录,判断用户输入的用户名和密码是否错误 vi login1.sh #!/bin/bash for ((i=0; i < 3; i++))do read username read password if test "$username" = ...
分类:系统相关   时间:2021-04-14 11:41:38    阅读次数:0
linux shell 之脚本优化
vi file_can_execute_or_not1.sh #!/bin/bash #判断输入的参数个数是否为两个 if [ $# -lt 2 ]then echo "The num of parameter is not right! " exit 0fi #判断用户输入的第一个文件是否可以读i ...
分类:系统相关   时间:2021-04-13 12:56:38    阅读次数:0
linux shell命令之非交互式Shell脚本
vi no_interaction_script1.sh #!/bin/bash #提示用户该脚本3秒后退出echo "This script will quit after 3 seconds. " #计时3s sleep 1echo -n "."sleep 1echo -n "."sleep 1 ...
分类:系统相关   时间:2021-04-13 12:16:49    阅读次数:0
c语言入门教程–-5判断语句
#include<stdio.h> int main() { int a=1; int b=1; if(a==b) { printf("相等"); } else { printf("不相等"); } return 0; } ...
分类:编程语言   时间:2021-04-13 12:15:37    阅读次数:0
linux shell之数组的特殊用法
vi string_array.sh #!/bin/bash city=(Nanjing Atlanta Massachusetts Marseilles) #建立一个简单的数组echo "Extracting Substring" #演示抽取子串功能echo ${city[*]:0} #抽取整个数 ...
分类:编程语言   时间:2021-04-13 12:08:59    阅读次数:0
mongodb 聚合查询
mongo shell 操作 aggregate 使用mongo db 的 aggregate 进行聚合操作,改操作传入的参数是一个数组 aggregate 操作的参数 match 相当于 mysql 的 where,传入的是筛选条件 示例: {$match : { 'os': 'win' } } ...
分类:数据库   时间:2021-04-13 12:04:07    阅读次数:0
二叉树的三种递归遍历算法和中序遍历的非递归算法
二叉树本身是一种递归的数据类型,二叉树的许多操作离不开递归。非递归遍历包括结点入栈,先访问右子树,再访问根节点,访问左子树,先序和后序的非递归算法有待调试。 #include <stdio.h> #include<stdlib.h> #include<stdbool.h> typedef char ...
分类:编程语言   时间:2021-04-12 12:56:41    阅读次数:0
对变量第三位进行四舍五入保留两位小数
1 #include<stdio.h> 2 int main() 3 { 4 float num; 5 int temp; 6 scanf("%f",&num); 7 temp=num*100+0.5; 8 num=(double)temp/100; 9 printf("%f",num); //不同 ...
分类:其他好文   时间:2021-04-12 12:28:11    阅读次数:0
LCA — 欧拉序 + ST表
LCA — 欧拉序+ST表 \(O(n\log n)\) 预处理,\(O(1)\) 询问?。 \(lca(x,y)=\) 欧拉序中最早出现的 \(x\) 和 \(y\) 中间深度最浅的点。 Luogu P3379 #include <bits/stdc++.h> using namespace st ...
分类:其他好文   时间:2021-04-12 12:13:56    阅读次数:0
安装Python3.7的步骤
访问Python的官网:https://www.python.org/,如下图所示: 鼠标放到downloads上面然后点击downloads for windows下面的Python3.7开始下载Python3.7.如下图所示: 下载完成后,在文件夹中打开所下载的Python-3.7.0然后双击打 ...
分类:编程语言   时间:2021-04-12 12:11:27    阅读次数:0
43065条   上一页 1 ... 23 24 25 26 27 ... 4307 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!