Skip to content

Instantly share code, notes, and snippets.

@ranapu
Last active March 29, 2017 17:07
Show Gist options
  • Save ranapu/1ccec4fa959d750f04c843e139157374 to your computer and use it in GitHub Desktop.
Save ranapu/1ccec4fa959d750f04c843e139157374 to your computer and use it in GitHub Desktop.
Compare the Triplets in Go
package main
import "fmt"
func main() {
var alice [3]int
var aliceScore, bobScore, bob int
for i := 0; i < 3; i++ {
fmt.Scan(&alice[i])
}
for i := 0; i < 3; i++ {
fmt.Scan(&bob)
if alice[i] > bob {
aliceScore++
} else if alice[i] < bob{
bobScore++
}
}
fmt.Print(aliceScore, bobScore)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment