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