Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var tournamentCount, points int
- fmt.Scanln(&tournamentCount)
- fmt.Scanln(&points)
- var tournamentPoints = 0
- var win = 0
- var currentTournament string
- for i := 0; i < tournamentCount; i++ {
- fmt.Scanln(¤tTournament)
- switch currentTournament {
- case "W":
- tournamentPoints += 2000
- win++
- case "F":
- tournamentPoints += 1200
- case "SF":
- tournamentPoints += 720
- }
- }
- fmt.Printf("Final points: %d\n", points + tournamentPoints)
- fmt.Printf("Average points: %d\n", tournamentPoints / tournamentCount)
- fmt.Printf("%.2f%%\n", float64(100.0 * win) / float64(tournamentCount))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement