Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "math"
- )
- func main() {
- var movieTime, scenes, sceneTime int
- fmt.Scanln(&movieTime)
- fmt.Scanln(&scenes)
- fmt.Scanln(&sceneTime)
- totalTime := 0.15 * float64(movieTime) + float64(scenes) * float64(sceneTime)
- if totalTime >= float64(movieTime) {
- fmt.Printf("Time is up! To complete the movie you need %d minutes.", int(math.Round(totalTime - float64(movieTime))))
- } else {
- fmt.Printf("You managed to finish the movie on time! You have %d minutes left!", int(math.Round(float64(movieTime) - totalTime)))
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement