using System.Collections.Generic;
public string Ten { get; set; }
public string Mau { get; set; }
public void NhapHinh(string mau)
Console.WriteLine("ten cua hinh: ");
Ten = Console.ReadLine();
Console.WriteLine("mau cua hinh: ");
Mau = Console.ReadLine();
public string Tam { get; set; }
public double BanKinh { get; set; }
public void NhapHinhTron(string ghichu)
Console.WriteLine("tam hinh tron: ");
this.Tam = Console.ReadLine();
Console.WriteLine("nhap ban kinh hinh tron: ");
this.BanKinh = double.Parse(Console.ReadLine());
public double TinhChuViTron()
double kq = Math.PI * this.BanKinh * 2.0;
public int ChieuDai { get; set; }
public int ChieuRong { get; set; }
public void NhapHinhChuNhat(string ghichu)
Console.WriteLine(ghichu);
Console.WriteLine("nhap chieu dai hinh chu nhat: ");
this.ChieuDai = int.Parse(Console.ReadLine());
Console.WriteLine("nhap chieu rong hinh chu nhat: ");
this.ChieuRong = int.Parse(Console.ReadLine());
public double TinhChuViChuNhat()
double kq = (this.ChieuDai + this.ChieuRong) * 2.0;
public List< HinhChuNhat> DSHinhChuNhat { get; set; }
public List<HinhTron> DSHinhTron { get; set; }
public void NhapMatPhangTrongKhonggian(string nhap)
Console.WriteLine("nhap so luong hinh chu nhat: ");
int n = int.Parse(Console.ReadLine());
for(int i = 0; i < n; i++)
HinhChuNhat cn = new HinhChuNhat();
this.DSHinhChuNhat.Add(cn);
Console.WriteLine("nhap so luong hinh tron: ");
int m = int.Parse(Console.ReadLine());
for (int i = 0; i < m; i++)
HinhTron tr = new HinhTron();
public double TongChuvi()
foreach(HinhChuNhat cn in DSHinhChuNhat)
kq = kq + cn.TinhChuViChuNhat();
foreach(HinhTron tr in DSHinhTron)
kq = kq + tr.TinhChuViTron();
static void Main(string[] args)
mt.NhapMatPhangTrongKhonggian("nhap thong tin ma phang");
double kq = mt.TongChuvi();
Console.WriteLine($"ket qua la: {kq}");