![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
go
YWF331
这个作者很懒,什么都没留下…
展开
-
go 100以内素数
package mainimport "fmt"func main() { var count int = 1 var flag bool for count < 100 { count++ flag = true for tmp:=2;tmp<count;tmp++{ if c...原创 2018-07-18 16:26:28 · 934 阅读 · 0 评论 -
go可以这么声明函数
func main(){ getSquareRoot := func(x float64) float64 { return math.Sqrt(x) } fmt.Println(getSquareRoot(9))}转载 2018-07-19 16:54:12 · 752 阅读 · 0 评论 -
聊天
package mainimport ( "net" "fmt")func main() { listen,err := net.Listen("tcp",":8080") if err != nil { fmt.Println("监听端口失败:",err)原创 2018-08-14 17:10:58 · 217 阅读 · 0 评论 -
go BinarySearch
package mainimport ( "fmt")func main() { num := []int{1,3,4,6,7,8,10} fmt.Println(BinarySearch(num,100))}func BinarySearch(lst []int,m int) int { low := 0 heigh := len(lst)...原创 2018-09-07 14:01:19 · 271 阅读 · 0 评论