public DanhBa TimTheoDuong(string duong) { DanhBa kq = new DanhBa(); for (int i = 0; i < length; i++) { if (a[i].diaChi.Contains(duong)) { kq.Them(a[i]); } } return(kq); }
static void Main(string[] args) { DanhBa db = new DanhBa(); db.NhapTuFile(); Console.WriteLine(db); //db.GhiFile(); //Console.WriteLine(" Danh sach thue bao co nhieu SDT \n"+db.TimThueBaoCoNhieuSDT()); //db.SapXepTheoChieuTangCuaTen(); db.SapXepGiamNgaySinh(); Console.WriteLine(" sau khi sap xep " + db); Console.ReadKey(); }
public DanhBa TimThueBaoCoNhieuSDT() { DanhBa kq = new DanhBa(); int max = TimSoLanSoThueBaoXuatHienNhieuNhat(); for (int i = 0; i < length; i++) { if (DemSoDTTheoThueBao(a[i].soCMND) == max && !kq.CoChua(a[i])) { kq.Them(a[i]); } } return(kq); }
static void Main(string[] args) { DanhBa db = new DanhBa(); db.Nhap(); db.NhapTuFile(); Console.WriteLine("Danh ba khach hang \n" + db); //Console.WriteLine("\n\n\n" + db.TimTheoSDT("012")); //Console.WriteLine("Danh sach khach hang duong phu dong"); //Console.WriteLine(db.TimTheoDuong("Phu Dong Thien Vuong")); int max = 0; // string duong = db.TimDuongSoLuongThueBaoCaoNhat(ref max); //Console.WriteLine("Duong {0} co so luong cao nhat la {1}",duong, max); // Console.WriteLine(db.TimDanhSachDuong()); Console.WriteLine(db.TimDuongSoLuongThueBaoCaoNhat(out max)); Console.WriteLine("So luong cao nhat la " + max); Console.ReadKey(); }