private void SanZiXian(List <int> sanlist, ref List <NumberModel> delnumberModels) { foreach (var item in AllNumer.GetAllNumer()) { string str = string.Empty; List <int> list = new List <int>(); list.Add(item.N1); list.Add(item.N2); list.Add(item.N3); list.Add(item.N4); list.Sort(); foreach (var k in list) { str = str + k.ToString(); } sanlist.Sort(); string v1 = sanlist[0].ToString() + sanlist[1].ToString() + sanlist[2].ToString(); string v2 = sanlist[1].ToString() + sanlist[2].ToString() + sanlist[3].ToString(); if (str.Contains(v1) || str.Contains(v2)) { Add(item, ref delnumberModels); } } }
private void btn_all_Click(object sender, EventArgs e) { allnumber = AllNumer.GetAllNumer(); this.tb_con.Text = string.Empty; this.tb_res.Text = string.Empty; delnumber.Clear(); Print(); }
private void btn_计算_Click(object sender, EventArgs e) { ResnumberModels = AllNumer.GetAllNumer(); CheckDelNumer(); foreach (var item in DelnumberModels) { var whereRemove = ResnumberModels.FirstOrDefault(S => S.N1 == item.N1 && S.N2 == item.N2 && S.N3 == item.N3 && S.N4 == item.N4); ResnumberModels.Remove(whereRemove); } PrintDel(); PrintRes(); }
public Form1() { InitializeComponent(); allnumber = AllNumer.GetAllNumer(); }