Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "math"
- )
- func main() {
- var steps, dancers, days int
- fmt.Scanln(&steps)
- fmt.Scanln(&dancers)
- fmt.Scanln(&days)
- dayStepPercent := math.Ceil(float64(steps) / float64(days) / float64(steps) * 100)
- dancerStepPercent := dayStepPercent / float64(dancers)
- if dayStepPercent < 13 {
- fmt.Printf("Yes, they will succeed in that goal! %.2f%%.\n", dancerStepPercent)
- } else {
- fmt.Printf("No, they will not succeed in that goal! Required %.2f%% steps to be learned per day.\n", dancerStepPercent)
- }
- }
- ИЛИ:
- package main
- import (
- "fmt"
- "math"
- )
- func main() {
- var steps, dancers, days float64
- fmt.Scanln(&steps)
- fmt.Scanln(&dancers)
- fmt.Scanln(&days)
- dayStepPercent := math.Ceil(steps / days / steps * 100)
- dancerStepPercent := dayStepPercent / dancers
- if dayStepPercent < 13 {
- fmt.Printf("Yes, they will succeed in that goal! %.2f%%.\n", dancerStepPercent)
- } else {
- fmt.Printf("No, they will not succeed in that goal! Required %.2f%% steps to be learned per day.\n", dancerStepPercent)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement