Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var won, lost, drawn, teamOneResult, teamTwoResult int
- var gameResult string
- for i := 0; i < 3; i++ {
- fmt.Scanln(&gameResult)
- teamOneResult = int(gameResult[0])
- teamTwoResult = int(gameResult[2])
- if teamOneResult > teamTwoResult {
- won++
- } else if teamTwoResult > teamOneResult {
- lost++
- } else {
- drawn++
- }
- }
- fmt.Printf("Team won %d games.\nTeam lost %d games.\nDrawn games: %d\n", won, lost, drawn)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement