Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "math"
- )
- func main() {
- var first, second, point int
- fmt.Scanln(&first)
- fmt.Scanln(&second)
- fmt.Scanln(&point)
- if point <= first && point >= second || point >= first && point <= second {
- fmt.Println("in")
- } else {
- fmt.Println("out")
- }
- fmt.Println(math.Min(math.Abs(float64(first) - float64(point)), math.Abs(float64(second) - float64(point))))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement