Advertisement
Spocoman

Skeleton

Oct 13th, 2024
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.65 KB | None | 0 0
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var minutes, seconds int
  7.     fmt.Scanln(&minutes)
  8.     fmt.Scanln(&seconds)
  9.    
  10.     control := minutes * 60 + seconds
  11.    
  12.     var lengthInMeters float64
  13.     fmt.Scanln(&lengthInMeters)
  14.    
  15.     var secondsFor100Meters int
  16.     fmt.Scanln(&secondsFor100Meters)
  17.    
  18.     time := lengthInMeters / 100 * float64(secondsFor100Meters) - lengthInMeters / 120 * 2.5
  19.  
  20.     if time <= float64(control) {
  21.         fmt.Printf("Marin Bangiev won an Olympic quota!\nHis time is %.3f.\n", time)
  22.     } else {
  23.         fmt.Printf("No, Marin failed! He was %.3f second slower.", time - float64(control))
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement