kk
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package rectangle
|
||||
|
||||
type Rect struct {
|
||||
A,B int
|
||||
color string
|
||||
}
|
||||
|
||||
func New(newA int, newB int, newColor string) *Rect {
|
||||
return &Rect{newA,newB,newColor}
|
||||
}
|
||||
|
||||
func (r *Rect) Perimeter() int {
|
||||
return 2 * (r.A + r.B)
|
||||
}
|
||||
Reference in New Issue
Block a user