Advertisement
Spocoman

Choreography

Oct 4th, 2024
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 1.15 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.   "fmt"
  5.   "math"
  6. )
  7.  
  8. func main() {
  9.     var steps, dancers, days int
  10.     fmt.Scanln(&steps)
  11.     fmt.Scanln(&dancers)
  12.     fmt.Scanln(&days)
  13.    
  14.     dayStepPercent := math.Ceil(float64(steps) / float64(days) / float64(steps) * 100)
  15.     dancerStepPercent := dayStepPercent / float64(dancers)
  16.  
  17.     if dayStepPercent < 13 {
  18.         fmt.Printf("Yes, they will succeed in that goal! %.2f%%.\n", dancerStepPercent)
  19.     } else {
  20.         fmt.Printf("No, they will not succeed in that goal! Required %.2f%% steps to be learned per day.\n", dancerStepPercent)
  21.     }
  22. }
  23.  
  24. ИЛИ:
  25.  
  26. package main
  27.  
  28. import (
  29.   "fmt"
  30.   "math"
  31. )
  32.  
  33. func main() {
  34.     var steps, dancers, days float64
  35.     fmt.Scanln(&steps)
  36.     fmt.Scanln(&dancers)
  37.     fmt.Scanln(&days)
  38.    
  39.     dayStepPercent := math.Ceil(steps / days / steps * 100)
  40.     dancerStepPercent := dayStepPercent / dancers
  41.  
  42.     if dayStepPercent < 13 {
  43.         fmt.Printf("Yes, they will succeed in that goal! %.2f%%.\n", dancerStepPercent)
  44.     } else {
  45.         fmt.Printf("No, they will not succeed in that goal! Required %.2f%% steps to be learned per day.\n", dancerStepPercent)
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement