This commit is contained in:
suguo.yao 2022-05-15 14:55:17 +08:00
parent 64764a6c9f
commit 03a9b0363a
2 changed files with 25 additions and 0 deletions

24
lesson01/main.go Normal file
View File

@ -0,0 +1,24 @@
package main
import (
"fmt"
"math/rand"
"time"
)
func main() {
t := 0
r := rand.New(rand.NewSource(time.Now().UnixNano()))
rows := r.Intn(100)
for x := 1; x <= rows; x++ {
if x > rows/2 {
t--
} else {
t++
}
for y := 0; y < t; y++ {
fmt.Print("*")
}
fmt.Print("\n")
}
}

1
lesson01/readme.md Normal file
View File

@ -0,0 +1 @@
流程控制学习