} // Chuyen noi dung XML thanh Nghiem public static Nghiem XMLtoNghiem(String xmlDoc) { Nghiem kq; XmlDocument doc = new XmlDocument(); doc.LoadXml(xmlDoc); XmlElement root = doc.DocumentElement; switch (root.Name) { case "NGHIEMBAC2": kq = new NghiemBac2(); break; case "NGHIEMBAC1": kq = new NghiemBac1(); break; default: kq = null; break; } kq.GetXMLDocument(xmlDoc); return(kq); }
public override Nghiem GiaiPT() { NghiemBac1 kq = new NghiemBac1(); if (A == 0) { if (B == 0) { kq.VoSoNghiem = true; } } else { kq.Add(-B / A); } return(kq); }