Last active
March 29, 2017 17:07
-
-
Save ranapu/1ccec4fa959d750f04c843e139157374 to your computer and use it in GitHub Desktop.
Compare the Triplets in Go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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