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.
Though it is unlikely that anyone did this problem in Go besides me, the same problem occurs when trying to use fmt.Fscan and then scanner.ReadString. The solution is to do the following.
_,_=fmt.Fscan(scanner,&mydoub)_,_:=scanner.ReadString('\n')//grabs the newlinemystr,_:=scanner.ReadString('\n')
Additionally, to properly print a float with 1 precision the %.1f verb is used.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 1: Data Types
You are viewing a single comment's thread. Return to all comments →
Though it is unlikely that anyone did this problem in Go besides me, the same problem occurs when trying to use fmt.Fscan and then scanner.ReadString. The solution is to do the following.
Additionally, to properly print a float with 1 precision the %.1f verb is used.