一个有参数但无提示说明的脚本#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
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
STP协议虽然能够解决环路问题,但是由于网络拓扑收敛较慢,影响了用户通信质量,而且如果网络中的拓扑结构频繁变化,网络也会随之频繁失去连通性,从而导致用户通信频繁中断,这也是用户无法忍受的。
由于STP的不足,IEEE于2001年发布的802.1w标准定义了RSTP。RSTP在STP基础上进行了... ...
分类:
其他好文 时间:
2021-04-13 12:41:31
阅读次数:
0
思路:遍历判断每个数的正负 class Solution { public: int arraySign(vector<int>& nums) { int ans = 1; for(auto &n : nums){ if(n == 0) return 0; ans *= (n > 0) ? 1 : ...
分类:
编程语言 时间:
2021-04-13 12:40:39
阅读次数:
0
函数题 /*练习5-1 求m到n之和 (10 分) 本题要求实现一个计算m~n(m<n)之间所有整数的和的简单函数。 函数接口定义: int sum( int m, int n ); 其中m和n是用户传入的参数,保证有m<n。函数返回的是m~n之间所有整数的和。 裁判测试程序样例: #include ...
分类:
编程语言 时间:
2021-04-13 12:28:09
阅读次数:
0
# 常用语句 ## 条件语句 ### if.....else.... while True: x = int(input("请输入数字:50")) if x >50: print("你输入的数大于50") else: print("你输入的值小于50") ### if....elif....else ...
分类:
其他好文 时间:
2021-04-13 12:27:47
阅读次数:
0
类型断言 .(type) 来实现 其中 type 对应的就是要断言的类型 接口类型断言 var num1 Number = 1 var num2 Number2 = &num1 if num3,ok := num2.(Number1);ok { fmt.Println(num3.Equal(1)) ...
分类:
其他好文 时间:
2021-04-13 12:19:31
阅读次数:
0
答案是对着这段区间 [L,R] 不断询问直到不存在 x+1 得来的; 例如一个区间有为 1,2,4,4; 首先询问 1,发现存在 1,ans = 1; 然后询问 ans+1 = 2,发现存在 2,则 [1,3] 都能凑出,ans = 3; 接着询问 ans+1 = 4,发现存在两个 4,则 [1,1 ...
分类:
其他好文 时间:
2021-04-13 12:16:27
阅读次数:
0
#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
c语言入门教程–-6循环语句 c语言提供了以下几种循环类型。while循环for 循环do…while 循环 while循环 #include <stdio.h> int main () { /* 局部变量定义 */ int a = 10; /* while 循环执行 */ while( a < 2 ...
分类:
编程语言 时间:
2021-04-13 12:12:17
阅读次数:
0