09 2021 档案

摘要:1. 入门 func print_hello() { // go 协成模型可以认真阅读, 常常见识 // https://i6448038.github.io/2017/12/04/golang-concurrency-principle/#:~:text=Go%E7%BA%BF%E7%A8%8B% 阅读全文
posted @ 2021-09-30 15:59 楠海 阅读(266) 评论(0) 推荐(0) 编辑
摘要:普通测试 package main import ( "fmt" ) func AddUpper(n int) int { res := 0 for i := 1; i <= n; i++ { res += i } return res } func main() { ans := AddUpper 阅读全文
posted @ 2021-09-29 15:39 楠海 阅读(38) 评论(0) 推荐(0) 编辑
摘要:从下往上看 package main import ( "bufio" "encoding/json" "flag" "fmt" "io" "io/ioutil" "os" ) type Monkey struct { Name string } type BirdAble interface { 阅读全文
posted @ 2021-09-29 14:28 楠海 阅读(42) 评论(0) 推荐(0) 编辑
摘要:上一次说明了, 原来的项目分配不是很好, 我又改了一个(但是因为没有使用数据库存储不能做到多用户注册登录功能) 项目目录 day01/familyaccount/model/account.go package model import "fmt" type AccountRecord struct 阅读全文
posted @ 2021-09-28 16:41 楠海 阅读(72) 评论(0) 推荐(0) 编辑
摘要:项目目录结构 familyaccount/main/main.go package main import ( utils "day01/familyaccount/utils" "fmt" ) func main() { var name, pwd string fmt.Println("请输入要 阅读全文
posted @ 2021-09-27 17:13 楠海 阅读(89) 评论(0) 推荐(1) 编辑
摘要:从下往上看, 可以复制到vscode中通过编辑器查看, 其中model/account.go表示model目录下的account.go文件, model是模块名 stu.go package main import "fmt" type Stud struct { Name string Age i 阅读全文
posted @ 2021-09-24 16:11 楠海 阅读(29) 评论(0) 推荐(0) 编辑
摘要:通过chrome商店搜索如下图中扩展插件可以变为护眼模式 关于google账号注册问题 通过chrome商店搜索上图(已添加)中的扩展插件, 安装好之后可以注册chrome上面的账号了.(主要是为了方便管理书签, 收集了好几年的书签一下再没了我就蒙了) 阅读全文
posted @ 2021-09-23 15:50 楠海 阅读(311) 评论(0) 推荐(0) 编辑
摘要:一些常用的东西(从下往上看) package main import ( "errors" "fmt" "math/rand" "strconv" "time" "unsafe" ) func test1() { var a int = 999 fmt.Println(a) var b uint = 阅读全文
posted @ 2021-09-18 13:40 楠海 阅读(55) 评论(0) 推荐(0) 编辑
摘要:位运算回溯 x = 0 x |= (1 << j) # 使用一位字节表示i, j对应位置被访问 self.dfs(i, j, self.root.children[u]) x &= ~(1 << j) # 恢复,又学到个位运算方法(&加~取反) 也就是说 x | (1 << j) & ~(1 << 阅读全文
posted @ 2021-09-17 15:58 楠海 阅读(24) 评论(0) 推荐(0) 编辑
摘要:原文链接:https://blog.csdn.net/qq_35531549/article/details/88405224 Python list内置sort()方法用来排序,也可以用python内置的全局sorted()方法来对可迭代的序列排序生成新的序列。 1)排序基础 简单的升序排序是非常 阅读全文
posted @ 2021-09-14 10:32 楠海 阅读(87) 评论(0) 推荐(0) 编辑
摘要:func test2() { var str string = "hello 北京" for i := 0; i < len(str); i++ { fmt.Printf("str[%d]=%c\n", i, str[i]) // 按照字节遍历, 到中文时乱码 } /* str[0]=h str[1 阅读全文
posted @ 2021-09-10 11:45 楠海 阅读(167) 评论(0) 推荐(0) 编辑
摘要:package main import ( "strings" ) func blank(n int) string { return strings.Repeat(" ", n) } // 关于官网这种代码结构是在很让人失望, 所有处理都在同一个函数中很不好 func fullJustify(wo 阅读全文
posted @ 2021-09-10 11:04 楠海 阅读(71) 评论(0) 推荐(0) 编辑
摘要:package main import ( "container/heap" "sort" ) func findMaximizedCapital(k, w int, profits, capital []int) int { n := len(profits) type pair struct { 阅读全文
posted @ 2021-09-08 17:07 楠海 阅读(82) 评论(0) 推荐(0) 编辑
摘要:class Solution(object): def smallestK(self, arr, k): """ :type arr: List[int] :type k: int :rtype: List[int] """ self.quick_sort(arr, 0, len(arr) - 1) 阅读全文
posted @ 2021-09-03 11:22 楠海 阅读(30) 评论(0) 推荐(0) 编辑

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