We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
this is an example of using the golang language, by adding the bufio and os packages so you can see if there are any more sentences after the first sentence
package main
import(
"fmt"
"bufio"
"os"
)
func main() {
//Enter your code here. Read input from STDIN. Print output to STDOUT
inputString := bufio.NewScanner(os.Stdin)
for inputString.Scan() {
fmt.Println("Hello, World.")
fmt.Println(inputString.Text()) // Println will add back the final '\n'
}
if err := inputString.Err(); err != nil {
fmt.Fprintln(os.Stderr, "reading standard input:", err)
}
}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 0: Hello, World.
You are viewing a single comment's thread. Return to all comments →
this is an example of using the golang language, by adding the bufio and os packages so you can see if there are any more sentences after the first sentence
package main import( "fmt" "bufio" "os" )
func main() { //Enter your code here. Read input from STDIN. Print output to STDOUT inputString := bufio.NewScanner(os.Stdin) for inputString.Scan() { fmt.Println("Hello, World.") fmt.Println(inputString.Text()) // Println will add back the final '\n' } if err := inputString.Err(); err != nil { fmt.Fprintln(os.Stderr, "reading standard input:", err) } }