Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "math"
- )
- func main() {
- var firstTime, secondTime, thirdTime, fatherTime float64
- fmt.Scanln(&firstTime)
- fmt.Scanln(&secondTime)
- fmt.Scanln(&thirdTime)
- fmt.Scanln(&fatherTime)
- cleaningTime := 1 / (1 / firstTime + 1 / secondTime + 1 / thirdTime) * 1.15
- fmt.Printf("Cleaning time: %.2f\n", cleaningTime)
- if fatherTime > cleaningTime {
- fmt.Printf("Yes, there is a surprise - time left -> %d hours.\n", int(fatherTime - cleaningTime))
- } else {
- fmt.Printf("No, there isn't a surprise - shortage of time -> %d hours.\n", int(math.Ceil(cleaningTime - fatherTime)))
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement