I am attempting to solve the SPOJ question that can be found here
Following is my solution:
package main import \"fmt\" import \"bufio\" import \"os
Try using bufio.Scanner (as suggested in the thread you mentioned):
bufio.Scanner
fmt.Scan(&n) fmt.Scan(&k) scanner := bufio.NewScanner(os.Stdin) for n > 0 { scanner.Scan() k, _ := strconv.Atoi(scanner.Text()) ...