Advertisement
Spocoman

Final Competition

Oct 9th, 2024
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.75 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var dancers int
  7.     fmt.Scanln(&dancers)
  8.    
  9.     var points float64
  10.     fmt.Scanln(&points)
  11.    
  12.     var season, destination string
  13.     fmt.Scanln(&season)
  14.     fmt.Scanln(&destination)
  15.    
  16.     totalSum := float64(dancers) * points
  17.        
  18.     if destination == "Abroad" {
  19.         totalSum *= 1.50
  20.         if season == "summer" {
  21.             totalSum *= 0.90
  22.         } else {
  23.             totalSum *= 0.85
  24.         }
  25.     } else {
  26.         if season == "summer" {
  27.             totalSum *= 0.95
  28.         } else {
  29.             totalSum *= 0.92
  30.         }
  31.     }
  32.  
  33.     fmt.Printf("Charity - %.2f\n", totalSum * 0.75)
  34.     fmt.Printf("Money per dancer - %.2f\n", totalSum * 0.25 / float64(dancers))
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement