Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concate ...
分类:
编程语言 时间:
2020-02-18 16:33:41
阅读次数:
88
1,如下定义的变量 b ,存储的就是字符串类型的值 b="hello" 或者 b='hello' 总结:双引号或者单引号中的数据,就是字符串 2,字符串输出 name=" lihua" print("姓名:%s " % name) 3,f-strings f-strings 提供一种简洁易读的方式, ...
分类:
其他好文 时间:
2020-02-17 21:25:03
阅读次数:
110
他的结构就是F+str 或者 f+str的形式,在字符串中想替换的位置用{}展位,与format类似,但是用在字符串后面写入替换的内容,而他可以直接识别 name = '小旋风' age = 18 sex = '男' msg = F'姓名:{name},性别:{age},年龄:{sex}' # 大写 ...
分类:
其他好文 时间:
2020-02-16 20:46:07
阅读次数:
63
传送门 A. Three Strings 题意:给三个长为n字符串a,b,c,需对字符串每一位都进行操作: i (1 ≤ i ≤ n ),ci?aior ci?bi,问是否能让a与b相等。 思路:对于每个i(1≤i≤n),其中n是字符串的长度。 如果ci等于ai,我们可以用bi交换它;如果ci等于b ...
分类:
其他好文 时间:
2020-02-16 17:58:08
阅读次数:
58
1 package info_websocket 2 3 import ( 4 "crypto/sha1" 5 "encoding/base64" 6 "errors" 7 "io" 8 "log" 9 "net" 10 "strings" 11 ) 12 13 func main() { 14 l ...
分类:
Web程序 时间:
2020-02-16 16:25:39
阅读次数:
93
[toc] ? 893. 特殊等价字符串组 https://leetcode cn.com/problems/groups of special equivalent strings 描述 ? 811. 子域名访问计数 https://leetcode cn.com/problems/subdoma ...
分类:
其他好文 时间:
2020-02-16 12:49:09
阅读次数:
92
package main import ( "fmt" "strings" ) func main() { str := "赵,钱,孙,李,赵" //字符串分割, 使用字符分割 str1 := strings.Split(str, ",") fmt.Println(str1[0]) //赵 fmt. ...
分类:
其他好文 时间:
2020-02-15 15:49:13
阅读次数:
85
下面介绍Delphi自带的字符串分割函数,根据你的需要来使用。1、ExtractStringsfunction ExtractStrings(Separators, WhiteSpace: TSysCharSet; Content: PChar; Strings: TStrings): Intege ...
A. Three Strings【思维】 题意:给你三个串a,b,c,对于串的每一个字符i,必须进行以下操作:swap(a_i,c_i)或者swap(b_i,c_i),问是否存在操作方案使得操作完之后使得ab串相等 题解:判断是否存在a_i,b_i同时不等于c_i的情况 #include<iostr ...
分类:
其他好文 时间:
2020-02-14 18:16:27
阅读次数:
85
A. Three Strings #include<iostream> #include<algorithm> using namespace std; int main(){ int t; scanf("%d",&t); while(t--){ string a,b,c; cin>>a>>b>>c ...
分类:
其他好文 时间:
2020-02-14 18:10:32
阅读次数:
119