jhg
This commit is contained in:
parent
b03d18828c
commit
62ef2b7eb2
|
|
@ -2,17 +2,16 @@ package main
|
|||
|
||||
import "fmt"
|
||||
|
||||
func square() func() int {
|
||||
var x int
|
||||
return func() int{
|
||||
x++
|
||||
return x*x
|
||||
func join(srt ...string) string {
|
||||
res := ""
|
||||
for _,s := range srt {
|
||||
fmt.Println(s)
|
||||
res = res + s + " "
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
func main() {
|
||||
f := square()
|
||||
fmt.Println(f())
|
||||
fmt.Println(f())
|
||||
fmt.Println(f())
|
||||
// s := []string{"lol","kik"}
|
||||
fmt.Println(join("lol","kek"))
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user