Shape interface
Lập trìnhTạo interface Shape và implement các hình
Hướng dẫn
Lời giải
Tạo: 1. Interface Shape với Area() và Perimeter() 2. Struct Circle implement Shape 3. Struct Rectangle implement Shape 4. Function in thông tin của Shape
Code mẫu
package main
import "fmt"
type Shape interface {
Area() float64
Perimeter() float64
}
// Viết code ở đây