Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var record, meters, secondPerMeter float64
- fmt.Scanln(&record)
- fmt.Scanln(&meters)
- fmt.Scanln(&secondPerMeter)
- score := meters * secondPerMeter + float64(int(meters / 50)) * 30
- if score < record {
- fmt.Printf("Yes! The new record is %.2f seconds.\n", score)
- } else {
- fmt.Printf("No! He was %.2f seconds slower.\n", score - record)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement