Files
moxa/_test/method9.go
2018-09-21 16:04:30 +02:00

16 lines
174 B
Go

package main
type Coord struct {
x, y int
}
func main() {
o := Coord{3, 4}
println(o.dist())
}
func (c Coord) dist() int { return c.x*c.x + c.y*c.y }
// Output:
// 25