Advertisement
Spocoman

Mountain Run

Oct 10th, 2024
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.44 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var record, meters, secondPerMeter float64
  7.     fmt.Scanln(&record)
  8.     fmt.Scanln(&meters)
  9.     fmt.Scanln(&secondPerMeter)
  10.    
  11.     score := meters * secondPerMeter + float64(int(meters / 50)) * 30
  12.  
  13.     if score < record {
  14.         fmt.Printf("Yes! The new record is %.2f seconds.\n", score)
  15.     } else {
  16.         fmt.Printf("No! He was %.2f seconds slower.\n", score - record)
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement