如何在Go中打印Hello World 100次? [关闭]

So I have this so far but I'm not sure what to add to make it print Hello world 100 times... any ideas?

package main

import "fmt"

func main() {
   fmt.Println("Hello world")
}

That would be something like (assuming the other code is correct):

package main
import "fmt"
func main() {
    for i := 0; i < 100; i++ {
        fmt.Println("Hello world")
    }
}

You should definitely use strings.Repeat:

package main

import (
    "fmt"
    "strings"
)

func main() {
    fmt.Print(strings.Repeat("Hello world
", 100))
}